Ejemplo n.º 1
0
def test_locate_file():
    assert locate_file() is None

    ttgt = path.join(get_basedir(), 'test')
    assert locate_file('test', must_exist=True) is None
    assert locate_file('test', must_exist=False) == ttgt

    itgt = path.join(get_basedir(), 'ffflash', 'info.py')
    assert locate_file('ffflash', 'info.py', must_exist=False) == itgt
    assert locate_file('ffflash', 'info.py', must_exist=True) == itgt

    assert locate_file('ffflash', must_exist=False) is None
    assert locate_file('ffflash', must_exist=True) is None

    assert locate_file('ffflash', 'what', 'ever', must_exist=False) is None
    assert locate_file('ffflash', 'what', 'ever', must_exist=True) is None
Ejemplo n.º 2
0
def test_get_basedir():
    assert get_basedir() == path.abspath(
        path.dirname(path.dirname(path.dirname(path.dirname(__file__))))
    )
Ejemplo n.º 3
0
def test_get_basedir():
    assert get_basedir() == path.abspath(
        path.dirname(path.dirname(path.dirname(path.dirname(__file__)))))