Merge pull request #1662 from jakedt/gcrandomtest
Add a test to make sure the random policy function runs.
This commit is contained in:
commit
61bc358516
1 changed files with 9 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
import unittest
|
import unittest
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from playhouse.test_utils import assert_query_count
|
||||||
|
|
||||||
from app import app, storage
|
from app import app, storage
|
||||||
from initdb import setup_database_for_testing, finished_database_for_testing
|
from initdb import setup_database_for_testing, finished_database_for_testing
|
||||||
from data import model, database
|
from data import model, database
|
||||||
|
@ -189,6 +191,13 @@ class TestGarbageCollection(unittest.TestCase):
|
||||||
self.assertIsNone(model.repository.find_repository_with_garbage(0))
|
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):
|
def test_one_tag(self):
|
||||||
""" Create a repository with a single tag, then remove that tag and verify that the repository
|
""" Create a repository with a single tag, then remove that tag and verify that the repository
|
||||||
is now empty. """
|
is now empty. """
|
||||||
|
|
Reference in a new issue