Merge lp:~brendan-donegan/qakit/get_instances_pagination into lp:qakit

Proposed by Brendan Donegan
Status: Merged
Approved by: Allan LeSage
Approved revision: 12
Merged at revision: 12
Proposed branch: lp:~brendan-donegan/qakit/get_instances_pagination
Merge into: lp:qakit
Diff against target: 38 lines (+6/-4)
2 files modified
qakit/practitest/practitest.py (+5/-4)
setup.py (+1/-0)
To merge this branch: bzr merge lp:~brendan-donegan/qakit/get_instances_pagination
Reviewer Review Type Date Requested Status
Allan LeSage (community) Approve
Review via email: mp+268529@code.launchpad.net

Commit message

Get all instances, handle instances with no external ID and add subunit as a dependency

Description of the change

Fix a couple of issues I hit whilst trying to upload results to a testset in PractiTest:

1.) get_instances was using _get and not _get_all so only ever got the first 250 instances, meaning some test results weren't uploaded
2.) get_test was being passed None when an instance had no external ID - this needed to be handled
3.) python-subunit was missing from the setup.py so couldn't run from the virtualenv

To post a comment you must log in.
Revision history for this message
Allan LeSage (allanlesage) wrote :

OK LGTM, merging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qakit/practitest/practitest.py'
2--- qakit/practitest/practitest.py 2015-06-30 14:44:59 +0000
3+++ qakit/practitest/practitest.py 2015-08-19 18:26:49 +0000
4@@ -184,7 +184,7 @@
5
6 """
7 url = PROD_PRACTITEST + '/sets/{}/instances.json'.format(id)
8- return self._get(url).json()['data']
9+ return self._get_all(url)
10
11 def create_instances(self, set_id, test_ids):
12 """
13@@ -283,9 +283,10 @@
14
15 """
16 test_id = self._get_id_of_test_by_name(instance['name'], tests)
17- # TODO: handle None
18- test = self.get_test(test_id)
19- return self.get_test_custom_field(test, custom_field_name)
20+ if test_id is not None:
21+ test = self.get_test(test_id)
22+ return self.get_test_custom_field(test, custom_field_name)
23+ return None
24
25 def get_issues(self, id):
26 """Return issues given a filter id
27
28=== modified file 'setup.py'
29--- setup.py 2015-06-23 14:57:17 +0000
30+++ setup.py 2015-08-19 18:26:49 +0000
31@@ -35,6 +35,7 @@
32 # 'bleach',
33 # 'prettytable',
34 'python-dateutil',
35+ 'python-subunit',
36 'requests',
37 # 'termcolor',
38 # 'trello',

Subscribers

People subscribed via source and target branches