Use cross-platform os.rename instead of system call to cp.

This commit is contained in:
Paul Romano 2013-08-14 20:09:27 -05:00
parent 288800d315
commit a2a09eef63
62 changed files with 64 additions and 64 deletions

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -29,7 +29,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -22,7 +22,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def test_run_restart():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -25,7 +25,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -28,7 +28,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -21,7 +21,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def test_restart_form1():
@ -36,7 +36,7 @@ def test_results_form1():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def test_restart_form2():
@ -51,7 +51,7 @@ def test_results_form2():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -24,7 +24,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -26,7 +26,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -25,7 +25,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():

View file

@ -23,7 +23,7 @@ def test_results():
os.system('python results.py')
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
if not compare:
os.system('cp results_test.dat results_error.dat')
os.rename('results_test.dat', 'results_error.dat')
assert compare
def teardown():