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
=== modified file 'qakit/practitest/practitest.py'
--- qakit/practitest/practitest.py 2015-06-30 14:44:59 +0000
+++ qakit/practitest/practitest.py 2015-08-19 18:26:49 +0000
@@ -184,7 +184,7 @@
184184
185 """185 """
186 url = PROD_PRACTITEST + '/sets/{}/instances.json'.format(id)186 url = PROD_PRACTITEST + '/sets/{}/instances.json'.format(id)
187 return self._get(url).json()['data']187 return self._get_all(url)
188188
189 def create_instances(self, set_id, test_ids):189 def create_instances(self, set_id, test_ids):
190 """190 """
@@ -283,9 +283,10 @@
283283
284 """284 """
285 test_id = self._get_id_of_test_by_name(instance['name'], tests)285 test_id = self._get_id_of_test_by_name(instance['name'], tests)
286 # TODO: handle None286 if test_id is not None:
287 test = self.get_test(test_id)287 test = self.get_test(test_id)
288 return self.get_test_custom_field(test, custom_field_name)288 return self.get_test_custom_field(test, custom_field_name)
289 return None
289290
290 def get_issues(self, id):291 def get_issues(self, id):
291 """Return issues given a filter id292 """Return issues given a filter id
292293
=== modified file 'setup.py'
--- setup.py 2015-06-23 14:57:17 +0000
+++ setup.py 2015-08-19 18:26:49 +0000
@@ -35,6 +35,7 @@
35 # 'bleach',35 # 'bleach',
36 # 'prettytable',36 # 'prettytable',
37 'python-dateutil',37 'python-dateutil',
38 'python-subunit',
38 'requests',39 'requests',
39 # 'termcolor',40 # 'termcolor',
40 # 'trello',41 # 'trello',

Subscribers

People subscribed via source and target branches