diff --git a/test/test_gc.py b/test/test_gc.py index e7646dc99..ce9f13e98 100644 --- a/test/test_gc.py +++ b/test/test_gc.py @@ -1,6 +1,8 @@ import unittest import time +from playhouse.test_utils import assert_query_count + from app import app, storage from initdb import setup_database_for_testing, finished_database_for_testing from data import model, database @@ -189,6 +191,13 @@ class TestGarbageCollection(unittest.TestCase): self.assertIsNone(model.repository.find_repository_with_garbage(0)) + def test_find_garbage_policy_functions(self): + with assert_query_count(1): + one_policy = model.repository.get_random_gc_policy() + all_policies = model.repository._get_gc_expiration_policies() + self.assertIn(one_policy, all_policies) + + def test_one_tag(self): """ Create a repository with a single tag, then remove that tag and verify that the repository is now empty. """