-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from IBM/fix/issue141
Fix/issue141
- Loading branch information
Showing
8 changed files
with
167 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PYTHONPATH=makei |
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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from utils import makeIncludeDirsAbsolute | ||
|
||
def test_sanity(): | ||
path = '/a/b/.logs/joblog.json' | ||
parameters = " some stuff at the begginning aINCDIR ('PARAM1' 'PARAM2' ''PARAM3'' 'PARAM4' )and some stuff after " | ||
expected = " some stuff at the begginning aINCDIR ('/a/b/PARAM1' '/a/b/PARAM2' ''/a/b/PARAM3'' '/a/b/PARAM4')and some stuff after " | ||
assert makeIncludeDirsAbsolute(path, parameters) == expected | ||
|
||
def test_empty_params(): | ||
path = '/a/b/.logs/joblog.json' | ||
parameters = " INCDIR ('' '''')" | ||
expected = " INCDIR ('/a/b/' ''/a/b/'')" | ||
assert makeIncludeDirsAbsolute(path, parameters) == expected | ||
|
||
def test_longer_job_log_path(): | ||
path = '/a/b/cd/efg/hijklmnop/.logs/joblog.json' | ||
parameters = " INCDIR( 'dir1' ''dir2'')" | ||
expected = " INCDIR('/a/b/cd/efg/hijklmnop/dir1' ''/a/b/cd/efg/hijklmnop/dir2'')" | ||
assert makeIncludeDirsAbsolute(path, parameters) == expected | ||
|
||
def test_doesnt_modify_absolute_path(): | ||
path = '/a/b/cd/efg/hijklmnop/.logs/joblog.json' | ||
parameters = " INCDIR( '/a/b/dir1' ''dir2'')" | ||
expected = " INCDIR('/a/b/dir1' ''/a/b/cd/efg/hijklmnop/dir2'')" | ||
assert makeIncludeDirsAbsolute(path, parameters) == expected | ||
|
||
def test_doesnt_modify_absolute_path_with_double_quotes(): | ||
path = '/a/b/cd/efg/hijklmnop/.logs/joblog.json' | ||
parameters = " INCDIR( ''/a/b/dir1'' ''dir2'')" | ||
expected = " INCDIR(''/a/b/dir1'' ''/a/b/cd/efg/hijklmnop/dir2'')" | ||
assert makeIncludeDirsAbsolute(path, parameters) == expected | ||
|
||
def test_no_preceding_path_before_logs(): | ||
path = '/.logs/joblog.json' | ||
parameters = " INCDIR('dir2')" | ||
expected = " INCDIR('/dir2')" | ||
assert makeIncludeDirsAbsolute(path, parameters) == expected | ||
|
||
def test_joblob_not_found(): | ||
path = '/a/b/cd/efg/hijklmnop/.logs/joblogs.json' | ||
parameters = " INCDIR( ''/a/b/dir1'' ''dir2'')" | ||
expected = " INCDIR(''/a/b/dir1'' ''dir2'')" | ||
assert makeIncludeDirsAbsolute(path, parameters) == expected |
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
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