예제 #1
0
def test_path_returns_Path_objects(cleanup_env):
    env = Env.start({'path': {'a': '/tmp/path/file.txt',
                              'b': '/another/path/file.csv'}})
    assert isinstance(env.path.a, Path)
    assert isinstance(env.path.b, Path)
예제 #2
0
def test_can_instantiate_env_if_located_in_sample_subdir(move_to_sample_subdir,
                                                         cleanup_env):
    Env.start()
예제 #3
0
def test_can_create_env_from_dict(cleanup_env):
    e = Env.start({'a': 1})
    assert e.a == 1
예제 #4
0
def test_version_placeholder(cleanup_env):
    env = Env.start({'module': 'sample_project', 'version': '{{version}}'})
    assert env.version == '0.1dev'
예제 #5
0
def test_init_with_nonexistent_package(cleanup_env):
    with pytest.raises(ImportError):
        Env.start({'module': 'i_do_not_exist'})
예제 #6
0
def test_init_with_module_key(cleanup_env):
    env = Env.start({'module': 'sample_project'})
    assert env.module == 'sample_project'