Пример #1
0
 def test_store_attributes_test01(self):
     store = RedisWhooshStore(directory=self.dir, clear=True, name="test", redis=fakeredis.FakeStrictRedis())
     store.update(self.test01, etag='test01', lazy=False)
     print(store.attributes())
     assert ATTRS['domain'] in store.attributes()
     assert ATTRS['role'] in store.attributes()
     assert ATTRS['collection'] not in store.attributes()
     assert 'example.com' in store.attribute(ATTRS['domain'])
     assert 'example.net' in store.attribute(ATTRS['domain'])
     assert 'foo.com' not in store.attribute(ATTRS['domain'])
Пример #2
0
 def test_create_store(self):
     store = RedisWhooshStore(directory=self.dir, clear=True, name="test", redis=fakeredis.FakeStrictRedis())
     assert store is not None
     assert store.size() == 0
     assert len(store.collections()) == 0
     assert str(store)
     assert not store.attributes()