Add a GC test for a noop
This commit is contained in:
parent
6ca0115b5e
commit
0c0cd693dd
1 changed files with 13 additions and 0 deletions
|
@ -58,6 +58,9 @@ class TestGarbageColection(unittest.TestCase):
|
|||
|
||||
return repo
|
||||
|
||||
def gcNow(self, repository):
|
||||
model.garbage_collect_repository(repository.namespace_user.username, repository.name)
|
||||
|
||||
def deleteTag(self, repository, tag):
|
||||
model.delete_tag(repository.namespace_user.username, repository.name, tag)
|
||||
model.garbage_collect_repository(repository.namespace_user.username, repository.name)
|
||||
|
@ -182,5 +185,15 @@ class TestGarbageColection(unittest.TestCase):
|
|||
self.deleteTag(repository, 'newtag')
|
||||
self.assertDeleted(repository, 'i1')
|
||||
|
||||
def test_empty_gc(self):
|
||||
repository = self.createRepository(
|
||||
latest = ['i1', 'i2', 'i3'],
|
||||
other = ['i1', 'f1', 'f2'],
|
||||
third = ['t1', 't2', 't3'],
|
||||
fourth = ['i1', 'f1'])
|
||||
|
||||
self.gcNow(repository)
|
||||
self.assertNotDeleted(repository,'i1', 'i2', 'i3', 't1', 't2', 't3', 'f1', 'f2')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Reference in a new issue