Skip to content

Commit 86679ea

Browse files
author
Peter Sprygada
committed
fix test case that wasn't rebased properly
Signed-off-by: Peter Sprygada <[email protected]>
1 parent 66db5ab commit 86679ea

File tree

1 file changed

+23
-31
lines changed

1 file changed

+23
-31
lines changed

test/integration/test_main.py

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def ensure_removed(path):
3333

3434
@contextmanager
3535
def temp_directory(files=None):
36-
3736
temp_dir = tempfile.mkdtemp()
3837
print(temp_dir)
3938
try:
@@ -135,26 +134,32 @@ def test_role_run_abs():
135134

136135

137136
def test_role_logfile():
138-
139-
rc = main(['-r', 'benthomasson.hello_role',
140-
'--hosts', 'localhost',
141-
'--roles-path', 'test/integration/project/roles',
142-
'--logfile', 'new_logfile',
143-
'run',
144-
'test/integration'])
145-
assert rc == 0
146-
ensure_removed("test/integration/artifacts")
147-
148-
149-
def test_role_logfile_abs():
150-
with temp_directory() as temp_dir:
137+
try:
151138
rc = main(['-r', 'benthomasson.hello_role',
152139
'--hosts', 'localhost',
153-
'--roles-path', os.path.join(HERE, 'project/roles'),
140+
'--roles-path', 'test/integration/project/roles',
154141
'--logfile', 'new_logfile',
155142
'run',
156-
temp_dir])
157-
assert rc == 0
143+
'test/integration'])
144+
assert os.path.exists('new_logfile')
145+
assert rc == 0
146+
finally:
147+
ensure_removed("test/integration/artifacts")
148+
149+
150+
def test_role_logfile_abs():
151+
try:
152+
with temp_directory() as temp_dir:
153+
rc = main(['-r', 'benthomasson.hello_role',
154+
'--hosts', 'localhost',
155+
'--roles-path', os.path.join(HERE, 'project/roles'),
156+
'--logfile', 'new_logfile',
157+
'run',
158+
temp_dir])
159+
assert os.path.exists('new_logfile')
160+
assert rc == 0
161+
finally:
162+
ensure_removed("new_logfile")
158163

159164

160165
def test_role_bad_project_dir():
@@ -172,6 +177,7 @@ def test_role_bad_project_dir():
172177
'bad_project_dir'])
173178
finally:
174179
os.unlink('bad_project_dir')
180+
ensure_removed("new_logfile")
175181

176182

177183
def test_role_run_clean():
@@ -206,20 +212,6 @@ def test_role_run_artifacts_dir():
206212
ensure_removed("test/integration/artifacts")
207213

208214

209-
def test_role_run_artifacts_dir_abs():
210-
with temp_directory() as temp_dir:
211-
rc = main(['-r', 'benthomasson.hello_role',
212-
'--hosts', 'localhost',
213-
'--roles-path', 'test/integration/roles',
214-
'--artifact-dir', os.path.join(tmpdir, 'otherartifacts'),
215-
'run',
216-
"test/integration"])
217-
assert os.path.exists(os.path.join(tmpdir, 'otherartifacts'))
218-
assert rc == 0
219-
finally:
220-
shutil.rmtree(tmpdir)
221-
222-
223215
def test_role_run_artifacts_dir_abs():
224216
try:
225217
with temp_directory() as temp_dir:

0 commit comments

Comments
 (0)