[copr] bkabrda-workspace: More tests for copr listing (96511f1)

bkabrda at fedorahosted.org bkabrda at fedorahosted.org
Tue Nov 20 13:42:49 UTC 2012


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : bkabrda-workspace

>---------------------------------------------------------------

commit 96511f1d1fd8fd46ed7c6888ae8bfa8a0785dfe5
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Tue Nov 20 14:42:30 2012 +0100

    More tests for copr listing


>---------------------------------------------------------------

 .../tests/test_views/test_coprs_ns/test_general.py |   24 +++++++++++++++++--
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/wsgi/tests/test_views/test_coprs_ns/test_general.py b/wsgi/tests/test_views/test_coprs_ns/test_general.py
index f5035cc..2174cb7 100644
--- a/wsgi/tests/test_views/test_coprs_ns/test_general.py
+++ b/wsgi/tests/test_views/test_coprs_ns/test_general.py
@@ -1,9 +1,27 @@
+import flask
+
 from tests.coprs_test_case import CoprsTestCase
 
 class TestCoprsShow(CoprsTestCase):
     def test_show_no_entries(self):
-        assert 'No entries here so far' in self.tc.get('/').data
+        assert 'No entries' in self.tc.get('/').data
 
-    def test_show_one_entry(self, f_data1):
+    def test_show_more_entries(self, f_users, f_coprs):
         r = self.tc.get('/')
-        assert r.data.count('<div class=copr>') == 1
+        assert r.data.count('<div class=copr>') == 3
+
+    def test_owned_none(self, f_users, f_coprs):
+        with self.tc as c:
+            with c.session_transaction() as s:
+                s['openid'] = self.u3.openid_name
+
+            r = c.get('/coprs/owned/{0}/'.format(self.u3.name))
+            assert r.data.find('No entries') != -1
+
+    def test_owned_one(self, f_users, f_coprs):
+        with self.tc as c:
+            with c.session_transaction() as s:
+                s['openid'] = self.u1.openid_name
+
+            r = c.get('/coprs/owned/{0}/'.format(self.u1.name))
+            assert r.data.count('<div class=copr>') == 1



More information about the copr-devel mailing list