[odrs-web: 3/4] Add tests
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [odrs-web: 3/4] Add tests
- Date: Tue, 29 Sep 2020 15:02:23 +0000 (UTC)
commit 308b6a44d4b4bae02309e88c8b46cf1f400dbcab
Author: Aleix Pol <aleixpol kde org>
Date: Wed Oct 9 18:06:57 2019 +0200
Add tests
app_data/odrs/tests/odrs_test.py | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/app_data/odrs/tests/odrs_test.py b/app_data/odrs/tests/odrs_test.py
index 15b2cdf..a50068b 100644
--- a/app_data/odrs/tests/odrs_test.py
+++ b/app_data/odrs/tests/odrs_test.py
@@ -410,7 +410,9 @@ class OdrsTest(unittest.TestCase):
locale='en_US',
distro='Fedora',
compat_ids=None,
- version='1.2.3'):
+ version='1.2.3',
+ limit=5,
+ start=0):
if not user_hash:
user_hash = self.user_hash
# fetch some reviews
@@ -418,15 +420,23 @@ class OdrsTest(unittest.TestCase):
'user_hash': user_hash,
'locale': locale,
'distro': distro,
- 'limit': 5,
+ 'limit': limit,
+ 'start': start,
'version': version}
if compat_ids:
data['compat_ids'] = compat_ids
return self.app.post('/1.0/reviews/api/fetch', data=json.dumps(data), follow_redirects=True)
def review_fetch(self):
- rv = self._review_fetch(app_id='inkscape.desktop')
+ rv = self._review_fetch(app_id='inkscape.desktop', start=0, limit=5)
assert b'An essential part of my daily workflow' in rv.data, rv.data
+ assert len(rv) == 5
+
+ rv = self._review_fetch(app_id='inkscape.desktop', start=0, limit=3)
+ assert len(rv) == 3
+
+ rv = self._review_fetch(app_id='inkscape.desktop', start=2, limit=3)
+ assert len(rv) == 3
def test_api_dumping_all(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]