self = <swh.storage.tests.test_cassandra.TestCassandraStorage object at 0x7f14e403b278>
swh_storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7f14e410e198>
def test_content_add(self, swh_storage):
cont = data.cont
insertion_start_time = datetime.datetime.now(tz=datetime.timezone.utc)
actual_result = swh_storage.content_add([cont])
insertion_end_time = datetime.datetime.now(tz=datetime.timezone.utc)
assert actual_result == {
"content:add": 1,
"content:add:bytes": cont["length"],
}
assert list(swh_storage.content_get([cont["sha1"]])) == [
{"sha1": cont["sha1"], "data": cont["data"]}
]
expected_cont = data.cont
del expected_cont["data"]
contents = [
obj
for (obj_type, obj) in swh_storage.journal_writer.journal.objects
if obj_type == "content"
]
assert len(contents) == 1
for obj in contents:
assert insertion_start_time <= obj.ctime
assert obj.ctime <= insertion_end_time
obj_d = obj.to_dict()
del obj_d["ctime"]
assert obj_d == expected_cont
swh_storage.refresh_stat_counters()
> assert swh_storage.stat_counters()["content"] == 1
E assert 2 == 1
E +2
E -1
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_storage.py:186: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Apr 21 2020, 2:18 PM