self = <swh.storage.tests.test_cassandra.TestCassandraStorage object at 0x7f7462b86550>
swh_storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7f746062b940>
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"]
journal_objects = list(swh_storage.journal_writer.journal.objects)
for (obj_type, obj) in journal_objects:
assert insertion_start_time <= obj["ctime"]
assert obj["ctime"] <= insertion_end_time
del obj["ctime"]
assert journal_objects == [("content", 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:167: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Apr 9 2020, 12:48 PM