def test_newfilechecks_test1(): """ Blank test, make sure all blanks don't do anything. """ addfile = "" newfile = "" path = "" _newfilechecks(addfile, newfile, path)
def test_newfilechecks_test4(): """ Check that if we have an input file in the cwd pointing to a file above this directory (../../) that an exception is raised. """ addfile = "test1.file" newfile = "../../test2.file" path = "path" with pytest.raises(exceptions.RequiredinputError): _newfilechecks(addfile, newfile, path)
def test_newfilechecks_test7(): """ If we have a newfile in a repx directory referenced from within a repx directory then this is bogus. """ addfile = "rep1/test1.file" newfile = "rep1/test2.file" path = "path" with pytest.raises(exceptions.RequiredinputError): _newfilechecks(addfile, newfile, path)
def test_newfilechecks_test8(): """ Test for newfile in repx. """ addfile = "test1.file" newfile = "rep2/test2.file" path = "path" newfile = _newfilechecks(addfile, newfile, path) assert newfile == "rep2/test2.file"
def test_newfilechecks_test5(): """ If we have a file in a repx directory refering to a file without ../ or rep/ in the path then it is likely to be in the same directory. Test this. """ addfile = "rep1/test1.file" newfile = "test2.file" path = "path" newfile = _newfilechecks(addfile, newfile, path) assert newfile == "rep1/test2.file"
def test_newfilechecks_test2(): """ Check that if we have an input file in a repx directory pointing to a file in the job parent directory (../) that newfile returns as cwd. """ addfile = "rep1/test1.file" newfile = "../test2.file" path = "path" newfile = _newfilechecks(addfile, newfile, path) assert newfile == "test2.file"