"A from B" => "B/A"

This commit is contained in:
Markus Unterwaditzer 2014-11-30 23:19:06 +01:00
parent 07fbd9cb89
commit c234bce656
2 changed files with 6 additions and 4 deletions

View file

@ -34,8 +34,9 @@ class BaseStorageTests(object):
@pytest.fixture @pytest.fixture
def get_storage(self, storage_args): def get_storage(self, storage_args):
def inner(**kw): def inner(collection=None, **kw):
return self.storage_class(**storage_args(**kw)) kw.update(storage_args(collection=collection))
return self.storage_class(**kw)
return inner return inner
@ -136,8 +137,9 @@ class BaseStorageTests(object):
in s.get_multi(href for href, etag in iteritems(info)) in s.get_multi(href for href, etag in iteritems(info))
) == info ) == info
def test_repr(self, s): def test_repr(self, s, get_storage):
assert self.storage_class.__name__ in repr(s) assert self.storage_class.__name__ in repr(s)
assert s.instance_name is None
class SupportsCollections(object): class SupportsCollections(object):

View file

@ -62,7 +62,7 @@ class Storage(object):
raise ValueError('This storage is read-only.') raise ValueError('This storage is read-only.')
self.read_only = bool(read_only) self.read_only = bool(read_only)
if collection and instance_name: if collection and instance_name:
instance_name = '{} from {}'.format(collection, instance_name) instance_name = '{}/{}'.format(instance_name, collection)
self.instance_name = instance_name self.instance_name = instance_name
self.collection = collection self.collection = collection