-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change name of utils.verify_path to utils.prepare_path
Better reflects its intent
- Loading branch information
Petter Johansson
committed
Dec 9, 2014
1 parent
52b1195
commit 29932e0
Showing
3 changed files
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
from pygromacs.utils import * | ||
|
||
def test_verify_path(): | ||
def test_prepare_path(): | ||
path = 'pygromacs/tests/grompp.mdp' | ||
directory, filename = os.path.split(path) | ||
bkpfile = "#%s.1#" % filename | ||
|
||
backup = verify_path('') | ||
backup = prepare_path('') | ||
assert (backup == "") | ||
backup = verify_path(path) | ||
backup = prepare_path(path) | ||
assert (backup == os.path.join(directory, bkpfile)) | ||
assert (os.access(backup, os.F_OK) == True) | ||
os.rename(backup, path) | ||
|
||
# Test creation of a new directory | ||
newdir = os.path.join(directory, 'verify_path_test') | ||
backup = verify_path(os.path.join(newdir, filename)) | ||
newdir = os.path.join(directory, 'prepare_path_test') | ||
backup = prepare_path(os.path.join(newdir, filename)) | ||
assert (backup == "") | ||
assert (os.path.isdir(newdir) == True) | ||
os.rmdir(newdir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters