From fab88cc468b3aefb6a4aad59222d5e51bf9b6f2a Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Jan 24 2017 13:29:06 +0000 Subject: [frontend] fix tests for unique mock triplets Fix 'f_mock_chroots_many' so it really complements 'f_mock_chroots', without clash. Fix some dependency issues between fixtures. Complements 4c2a8391c5c241941684ac3aaa973dbb --- diff --git a/frontend/coprs_frontend/tests/coprs_test_case.py b/frontend/coprs_frontend/tests/coprs_test_case.py index c989155..ca10569 100644 --- a/frontend/coprs_frontend/tests/coprs_test_case.py +++ b/frontend/coprs_frontend/tests/coprs_test_case.py @@ -183,10 +183,11 @@ class CoprsTestCase(object): def f_mock_chroots_many(self): """ Adds more chroots to self.c1 + Requires: f_mock_chroots """ self.mc_list = [] for arch in ["x86_64", "i386"]: - for os_version in range(17, 22): + for os_version in range(19, 24): mc = models.MockChroot( os_release="fedora", os_version=os_version, arch=arch, is_active=True) @@ -310,16 +311,17 @@ class CoprsTestCase(object): 'epel-6-i386': 0, 'epel-6-x86_64': 3, 'epel-7-x86_64': 4, - 'fedora-17-i386': 5, - 'fedora-17-x86_64': 6, - 'fedora-18-i386': 2, - 'fedora-18-x86_64': 3, - 'fedora-19-i386': 0, - 'fedora-19-x86_64': 0, - 'fedora-20-i386': 1, - 'fedora-20-x86_64': 1, - 'fedora-21-i386': 1, - 'fedora-21-x86_64': 4 + 'fedora-18-x86_64': 5, + 'fedora-19-i386': 5, + 'fedora-19-x86_64': 6, + 'fedora-20-i386': 2, + 'fedora-20-x86_64': 3, + 'fedora-21-i386': 0, + 'fedora-21-x86_64': 0, + 'fedora-22-i386': 1, + 'fedora-22-x86_64': 1, + 'fedora-23-i386': 1, + 'fedora-23-x86_64': 4, } for chroot in self.b_many_chroots.copr.active_chroots: diff --git a/frontend/coprs_frontend/tests/test_api/test_build_task_r.py b/frontend/coprs_frontend/tests/test_api/test_build_task_r.py index efede07..192574b 100644 --- a/frontend/coprs_frontend/tests/test_api/test_build_task_r.py +++ b/frontend/coprs_frontend/tests/test_api/test_build_task_r.py @@ -47,6 +47,7 @@ class TestBuildTaskResource(CoprsTestCase): def test_collection_ok_by_state( self, f_users, f_coprs, + f_mock_chroots, f_mock_chroots_many, f_build_many_chroots, f_db, diff --git a/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py b/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py index 3e546a9..a2a1c91 100644 --- a/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py +++ b/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py @@ -615,6 +615,9 @@ class TestCoprDelete(CoprsTestCase): class TestCoprRepoGeneration(CoprsTestCase): + """ + Requires f_mock_chroots + """ @pytest.fixture def f_custom_builds(self): """ Custom builds are used in order not to break the default ones """ @@ -626,9 +629,6 @@ class TestCoprRepoGeneration(CoprsTestCase): self.b7 = self.models.Build( copr=self.c1, user=self.u1, submitted_on=10, results="https://bar.baz") - self.mc1 = self.models.MockChroot( - os_release="fedora", os_version="18", arch="x86_64") - self.cc1 = self.models.CoprChroot(mock_chroot=self.mc1, copr=self.c1) # assign with chroots for build in [self.b5, self.b6, self.b7]: @@ -640,7 +640,7 @@ class TestCoprRepoGeneration(CoprsTestCase): ) self.db.session.add_all( - [self.b5, self.b6, self.b7, self.mc1, self.cc1]) + [self.b5, self.b6, self.b7]) @pytest.fixture def f_not_finished_builds(self):