Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smn committed Jul 13, 2015
1 parent efc53a4 commit d31db77
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions consular/tests/test_main.py
Expand Up @@ -228,3 +228,24 @@ def test_sync_app_task(self):
self.assertEqual(consul_request['method'], 'PUT')
consul_request['deferred'].callback('')
yield d

@inlineCallbacks
def test_sync_app(self):
app = {'id': '/my-app'}
d = self.consular.sync_app(app)
marathon_request = yield self.marathon_requests.get()
self.assertEqual(marathon_request['path'], '/v2/apps/my-app/tasks')
self.assertEqual(marathon_request['method'], 'GET')
marathon_request['deferred'].callback(
FakeResponse(200, [], json.dumps({'tasks': []})))
yield d

@inlineCallbacks
def test_sync_apps(self):
d = self.consular.sync_apps()
marathon_request = yield self.marathon_requests.get()
self.assertEqual(marathon_request['path'], '/v2/apps')
self.assertEqual(marathon_request['method'], 'GET')
marathon_request['deferred'].callback(
FakeResponse(200, [], json.dumps({'apps': []})))
yield d

0 comments on commit d31db77

Please sign in to comment.