Skip to content

Commit

Permalink
Add docstrings to new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JayH5 committed Sep 10, 2015
1 parent e47aba1 commit b8e12b5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions consular/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,16 @@ def tearDown(self):
pass

def test_reg_id_tag(self):
""" Consular's registration ID tag is properly formed. """
self.assertEqual(self.consular.reg_id_tag(), 'consular-reg-id=test')

def test_app_id_tag(self):
""" Consular's application ID tag is properly formed. """
self.assertEqual(self.consular.app_id_tag('test'),
'consular-app-id=test')

def test_get_app_id_from_tags(self):
""" The app ID is successfully parsed from the Consul tags. """
tags = [
'randomstuff',
'consular-reg-id=test',
Expand All @@ -101,13 +104,20 @@ def test_get_app_id_from_tags(self):
self.assertEqual(self.consular.get_app_id_from_tags(tags), '/my-app')

def test_get_app_id_from_tags_not_found(self):
"""
None is returned when the app ID cannot be found in the Consul tags.
"""
tags = [
'randomstuff',
'consular-reg-id=test',
]
self.assertEqual(self.consular.get_app_id_from_tags(tags), None)

def test_get_app_id_from_tags_multiple(self):
"""
An exception is raised when multiple app IDs are found in the Consul
tags.
"""
tags = [
'randomstuff',
'consular-reg-id=test',
Expand Down

0 comments on commit b8e12b5

Please sign in to comment.