Пример #1
0
def test_newfilechecks_test1():
    """
    Blank test, make sure all blanks don't do anything.
    """

    addfile = ""
    newfile = ""
    path = ""

    _newfilechecks(addfile, newfile, path)
Пример #2
0
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)
Пример #3
0
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)
Пример #4
0
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"
Пример #5
0
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"
Пример #6
0
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"