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'
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')
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']
def test_register_path(): registry.register('/tmp') assert '/tmp' in registry.get_registry()