Permalink
Browse files

initial implementation

  • Loading branch information...
1 parent 1199d30 commit c25cc5c72f99d585b1c8aae9ef0cab598bcf805f Jeff Hammel committed Jul 20, 2012
Showing with 14 additions and 11 deletions.
  1. +14 −11 dzclient/client.py
View
@@ -75,8 +75,9 @@ def add_datazilla_result(self, res):
"""Join a DatazillaResult object to the results."""
self.results.join_results(res.results)
- def submit(self):
- """Submit test data to datazilla server, return list of responses."""
+ def datasets(self):
+ """Return the datasets in JSON serializable form"""
+
perf_json = {
'test_machine' : {
'name': self.machine_name,
@@ -93,25 +94,27 @@ def submit(self):
},
'testrun' : {
'date': self.test_date,
- 'suite': "",
- },
- 'results': {},
+ }
}
datasets = []
for suite, data in self.results.results.items():
- perf_json['testrun']['suite'] = suite
- perf_json['results'] = data;
- datasets.append(deepcopy(perf_json))
- perf_json['results'] = {}
+ dataset = deepcopy(perf_json)
+ dataset['testrun']['suite'] = suite
+ dataset['results'] = deepcopy(data)
+ datasets.append(dataset)
+
+ return datasets
+
+ def submit(self):
+ """Submit test data to datazilla server, return list of responses."""
responses = []
- for dataset in datasets:
+ for dataset in self.datasets:
responses.append(self.send(dataset))
return responses
-
def send(self, dataset):
"""Send given dataset to server; returns httplib Response."""
path = "/%s/api/load_test" % (self.project)

0 comments on commit c25cc5c

Please sign in to comment.