Skip to content

Commit

Permalink
Merge pull request #39 from levi-rs/add-get-results-by-run-support
Browse files Browse the repository at this point in the history
Update parameter order for some methods
  • Loading branch information
levi-rs committed Aug 2, 2017
2 parents b34ebab + 3ccb05a commit 0ab0a77
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions traw/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def results(self, *args, **kwargs): # pylint: disable=unused-argument
raise NotImplementedError(const.NOTIMP.format("models.Test or int"))

@results.register(int)
def _results_by_obj_id(self, obj_id, obj_type=models.Test, limit=None, with_status=None):
def _results_by_obj_id(self, obj_id, obj_type=models.Test, with_status=None, limit=None):
API_METHODS = {models.Run: self.api.results_by_run_id,
models.Test: self.api.results_by_test_id}
if obj_type not in API_METHODS:
Expand All @@ -619,14 +619,14 @@ def _results_by_obj_id(self, obj_id, obj_type=models.Test, limit=None, with_stat
yield models.Result(self, result)

@results.register(models.Run)
def _results_by_run(self, run, limit=None, with_status=None):
params = dict(limit=limit, with_status=with_status, obj_type=models.Run)
def _results_by_run(self, run, with_status=None, limit=None):
params = dict(obj_type=models.Run, with_status=with_status, limit=limit)
for result in self.results(run.id, **params):
yield result

@results.register(models.Test)
def _results_by_test(self, test, limit=None, with_status=None):
for result in self.results(test.id, limit=limit, with_status=with_status):
def _results_by_test(self, test, with_status=None, limit=None):
for result in self.results(test.id, with_status=with_status, limit=limit):
yield result

# Run related methods
Expand Down Expand Up @@ -735,13 +735,13 @@ def _runs_by_project_id(self, project_id, **kwargs):

@runs.register(models.Project)
def _runs_by_project(self, project, created_after=None, created_before=None,
created_by=None, is_completed=None, limit=None,
milestone=None, suite=None):
created_by=None, is_completed=None, milestone=None,
suite=None, limit=None):

for run in self.runs(project.id, created_after=created_after,
created_before=created_before, created_by=created_by,
is_completed=is_completed, limit=limit,
milestone=milestone, suite=suite):
is_completed=is_completed,
milestone=milestone, suite=suite, limit=limit):
yield run

# Section related methods
Expand Down

0 comments on commit 0ab0a77

Please sign in to comment.