Permalink
Browse files

Merge pull request #29 from k0s/master

  • Loading branch information...
2 parents 36ee1f6 + 7c3d9b3 commit 2842ef76776c2263e705920ad8e69205ae4ca98d k0s committed Dec 17, 2012
Showing with 11 additions and 6 deletions.
  1. +2 −0 dzclient/client.py
  2. +9 −6 dzclient/tests/test_datazilla_request.py
View
@@ -185,6 +185,8 @@ def __init__(self, protocol, host, project, oauth_key, oauth_secret, **kw):
DatazillaResultsCollection.__init__(self, **kw)
+ # ensure the required parameters are given
+ assert self.branch, "%s: branch required for posting" % (self.__class__.__name__)
def submit(self):
"""Submit test data to datazilla server, return list of responses."""
@@ -7,15 +7,16 @@ class DatazillaRequestTest(unittest.TestCase):
def test_init_with_date(self):
"""Can provide test date on instantiation."""
req = DatazillaRequest(
- 'http', 'host', 'project', 'key', 'secret', test_date=12345)
+ 'http', 'host', 'project', 'key', 'secret', test_date=12345, branch='mozilla-try')
self.assertEqual(req.test_date, 12345)
def test_add_datazilla_result(self):
"""Can add a DatazillaResult to a DatazillaRequest."""
req = DatazillaRequest(
- 'http', 'host', 'project', 'key', 'secret'
+ 'http', 'host', 'project', 'key', 'secret',
+ branch='mozilla-try'
)
res = DatazillaResult({'suite': {'test': [1, 2, 3]}})
@@ -27,7 +28,8 @@ def test_add_datazilla_result(self):
def test_add_second_datazilla_result(self):
"""Adding a second DatazillaResult joins their results."""
req = DatazillaRequest(
- 'http', 'host', 'project', 'key', 'secret'
+ 'http', 'host', 'project', 'key', 'secret',
+ branch='mozilla-try'
)
res1 = DatazillaResult({'suite1': {'test': [1]}})
res2 = DatazillaResult({'suite2': {'test': [2]}})
@@ -42,7 +44,8 @@ def test_add_second_datazilla_result(self):
def test_create_from_results_collection(self):
collection = DatazillaResultsCollection(machine_name='localhost',
- os='linux')
+ os='linux',
+ branch='mozilla-try')
test_date = collection.test_date
req = DatazillaRequest.create(
'http', 'host', 'project', 'key', 'secret', collection
@@ -182,7 +185,7 @@ def test_send(self,
project = "project"
key = "oauth-key"
secret = "oauth-secret"
- req = DatazillaRequest(protocol, host, project, key, secret)
+ req = DatazillaRequest(protocol, host, project, key, secret, branch='mozilla-try')
mock_conn = mock_HTTPConnection.return_value
mock_request = mock_conn.request
@@ -216,7 +219,7 @@ def test_send_without_oauth(self, mock_HTTPConnection):
project = "project"
key = None
secret = None
- req = DatazillaRequest(protocol, host, project, key, secret)
+ req = DatazillaRequest(protocol, host, project, key, secret, branch='mozilla-try')
mock_conn = mock_HTTPConnection.return_value
mock_request = mock_conn.request

0 comments on commit 2842ef7

Please sign in to comment.