Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : dist-git
---------------------------------------------------------------
commit 84a5ee1a5570925fc87670b581b793fe5caa998b
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Wed Jun 24 12:51:03 2015 +0200
fix tests
---------------------------------------------------------------
.../tests/test_logic/test_builds_logic.py | 18 ++++++++++++++++--
.../test_backend_ns/test_backend_general.py | 5 +++++
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/frontend/coprs_frontend/tests/test_logic/test_builds_logic.py
b/frontend/coprs_frontend/tests/test_logic/test_builds_logic.py
index 9423c36..89384b4 100644
--- a/frontend/coprs_frontend/tests/test_logic/test_builds_logic.py
+++ b/frontend/coprs_frontend/tests/test_logic/test_builds_logic.py
@@ -72,12 +72,12 @@ class TestBuildsLogic(CoprsTestCase):
def test_build_queue_1(self, f_users, f_coprs, f_mock_chroots, f_builds, f_db):
self.db.session.commit()
- data = BuildsLogic.get_build_task_queue().all()
+ data = BuildsLogic.get_build_uploading_queue().all()
assert len(data) == 5
def test_build_queue_2(self, f_users, f_coprs, f_mock_chroots, f_db):
self.db.session.commit()
- data = BuildsLogic.get_build_task_queue().all()
+ data = BuildsLogic.get_build_uploading_queue().all()
assert len(data) == 0
def test_build_queue_3(self, f_users, f_coprs, f_mock_chroots, f_builds, f_db):
@@ -106,6 +106,20 @@ class TestBuildsLogic(CoprsTestCase):
assert len(data) == 1
assert data[0] == self.b1_bc[0]
+ def test_build_queue_5(self, f_users, f_coprs, f_mock_chroots, f_builds, f_db):
+ for build_chroots in [self.b2_bc, self.b3_bc, self.b4_bc]:
+ for build_chroot in build_chroots:
+ build_chroot.status = 4 # pending
+ self.db.session.commit()
+ data = BuildsLogic.get_build_task_queue().all()
+ assert len(data) == 5
+
+ def test_build_queue_6(self, f_users, f_coprs, f_mock_chroots, f_db):
+ self.db.session.commit()
+ data = BuildsLogic.get_build_task_queue().all()
+ assert len(data) == 0
+
+
def test_delete_build_exceptions(
self, f_users, f_coprs, f_mock_chroots, f_builds, f_db):
self.db.session.commit()
diff --git
a/frontend/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py
b/frontend/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py
index ec15ddb..2674b61 100644
--- a/frontend/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py
+++ b/frontend/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py
@@ -13,6 +13,11 @@ class TestWaitingBuilds(CoprsTestCase):
def test_waiting_build_only_lists_not_started_or_ended(
self, f_users, f_coprs, f_mock_chroots, f_builds, f_db):
+ for build_chroots in [self.b2_bc, self.b3_bc, self.b4_bc]:
+ for build_chroot in build_chroots:
+ build_chroot.status = 4 # pending
+ self.db.session.commit()
+
r = self.tc.get("/backend/waiting/", headers=self.auth_header)
assert len(json.loads(r.data)["builds"]) == 5