Beispiel #1
0
 def test_chunks_cleanup_after_max_retention(self, client):
     uuid = str(uuid4())
     self.create_chunks(uuid)
     purge_chunks.apply()
     assert list(storages.chunks.list_files()) == []
     assert not storages.chunks.exists(
         uuid)  # Directory should be removed too
Beispiel #2
0
 def test_chunks_kept_before_max_retention(self, client):
     not_expired = datetime.now()
     expired = datetime.now() - timedelta(hours=2)
     expired_uuid = str(uuid4())
     active_uuid = str(uuid4())
     parts = 3
     self.create_chunks(expired_uuid, nb=parts, last=expired)
     self.create_chunks(active_uuid, nb=parts, last=not_expired)
     purge_chunks.apply()
     expected = set([chunk_filename(active_uuid, i) for i in range(parts)])
     expected.add(chunk_filename(active_uuid, META))
     assert set(storages.chunks.list_files()) == expected
Beispiel #3
0
 def test_chunks_kept_before_max_retention(self, client):
     not_expired = datetime.now()
     expired = datetime.now() - timedelta(hours=2)
     expired_uuid = str(uuid4())
     active_uuid = str(uuid4())
     parts = 3
     self.create_chunks(expired_uuid, nb=parts, last=expired)
     self.create_chunks(active_uuid, nb=parts, last=not_expired)
     purge_chunks.apply()
     expected = set([
         chunk_filename(active_uuid, i) for i in range(parts)
     ])
     expected.add(chunk_filename(active_uuid, META))
     assert set(storages.chunks.list_files()) == expected
     assert not storages.chunks.exists(expired_uuid)  # Directory should be removed too
Beispiel #4
0
 def test_chunks_cleanup_after_max_retention(self, client):
     uuid = str(uuid4())
     self.create_chunks(uuid)
     purge_chunks.apply()
     assert list(storages.chunks.list_files()) == []
     assert not storages.chunks.exists(uuid)  # Directory should be removed too
Beispiel #5
0
 def test_chunks_cleanup_after_max_retention(self, client):
     uuid = str(uuid4())
     self.create_chunks(uuid)
     purge_chunks.apply()
     assert list(storages.chunks.list_files()) == []