Example #1
0
def test_register_alias_path():
    registry.register('/tmp', 'foobar')
    projects = registry.get_registry()
    assert '/tmp' in projects
    assert projects['/tmp']['alias'] == 'foobar'
    aliases = registry.get_aliases()
    assert 'foobar' in aliases
    assert aliases['foobar'] == '/tmp'
Example #2
0
def test_register_alias_path():
    registry.register('/tmp', 'foobar')
    projects = registry.get_registry()
    assert '/tmp' in projects
    assert projects['/tmp']['alias'] == 'foobar'
    aliases = registry.get_aliases()
    assert 'foobar' in aliases
    assert aliases['foobar'] == '/tmp'
Example #3
0
def test_register_save():
    registry.register('/tmp')
    registry.save_registry()
    with open(util.get_registry_filename(), 'r') as file:
        _registry = load(file, Loader=Loader) or default
        assert 'projects' in _registry
        _projects = _registry['projects']
        assert isinstance(_projects, dict)
        assert '/tmp' in _projects
    registry.unregister('/tmp')
Example #4
0
def test_register_save():
    registry.register('/tmp')
    registry.save_registry()
    with open(util.get_registry_filename(), 'r') as file:
        _registry = load(file, Loader=Loader) or default
        assert 'projects' in _registry
        _projects = _registry['projects']
        assert isinstance(_projects, dict)
        assert '/tmp' in _projects
    registry.unregister('/tmp')
Example #5
0
def test_register_alias_save():
    registry.register('/tmp', 'foobar')
    registry.save_registry()
    with open(util.get_registry_filename(), 'r') as file:
        _registry = load(file, Loader=Loader) or default
        assert 'projects' in _registry
        _projects = _registry['projects']
        assert isinstance(_projects, dict)
        assert '/tmp' in _projects
        assert 'alias' in _projects['/tmp']
        assert 'foobar' == _projects['/tmp']['alias']
Example #6
0
def test_register_alias_save():
    registry.register('/tmp', 'foobar')
    registry.save_registry()
    with open(util.get_registry_filename(), 'r') as file:
        _registry = load(file, Loader=Loader) or default
        assert 'projects' in _registry
        _projects = _registry['projects']
        assert isinstance(_projects, dict)
        assert '/tmp' in _projects
        assert 'alias' in _projects['/tmp']
        assert 'foobar' == _projects['/tmp']['alias']
Example #7
0
def test_register_path():
    registry.register('/tmp')
    assert '/tmp' in registry.get_registry()
Example #8
0
def test_register_path():
    registry.register('/tmp')
    assert '/tmp' in registry.get_registry()