Skip to content

Commit

Permalink
Made the tests comply with 80 char lengths per @jamesls's request.
Browse files Browse the repository at this point in the history
  • Loading branch information
toastdriven committed Mar 22, 2013
1 parent 70b97de commit 302ebc8
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions tests/unit/utils/test_utils.py
Expand Up @@ -109,19 +109,49 @@ def test_string_with_numbers(self):
class TestBuildInstanceMetadataURL(unittest.TestCase): class TestBuildInstanceMetadataURL(unittest.TestCase):
def test_normal(self): def test_normal(self):
# This is the all-defaults case. # This is the all-defaults case.
self.assertEqual(_build_instance_metadata_url('http://169.254.169.254', 'latest', 'meta-data'), 'http://169.254.169.254/latest/meta-data/') self.assertEqual(_build_instance_metadata_url(
'http://169.254.169.254',
'latest',
'meta-data'
),
'http://169.254.169.254/latest/meta-data/'
)


def test_custom_path(self): def test_custom_path(self):
self.assertEqual(_build_instance_metadata_url('http://169.254.169.254', 'latest', 'dynamic'), 'http://169.254.169.254/latest/dynamic/') self.assertEqual(_build_instance_metadata_url(
'http://169.254.169.254',
'latest',
'dynamic'
),
'http://169.254.169.254/latest/dynamic/'
)


def test_custom_version(self): def test_custom_version(self):
self.assertEqual(_build_instance_metadata_url('http://169.254.169.254', '1.0', 'meta-data'), 'http://169.254.169.254/1.0/meta-data/') self.assertEqual(_build_instance_metadata_url(
'http://169.254.169.254',
'1.0',
'meta-data'
),
'http://169.254.169.254/1.0/meta-data/'
)


def test_custom_url(self): def test_custom_url(self):
self.assertEqual(_build_instance_metadata_url('http://10.0.1.5', 'latest', 'meta-data'), 'http://10.0.1.5/latest/meta-data/') self.assertEqual(_build_instance_metadata_url(
'http://10.0.1.5',
'latest',
'meta-data'
),
'http://10.0.1.5/latest/meta-data/'
)


def test_all_custom(self): def test_all_custom(self):
self.assertEqual(_build_instance_metadata_url('http://10.0.1.5', '2013-03-22', 'user-data'), 'http://10.0.1.5/2013-03-22/user-data/') self.assertEqual(_build_instance_metadata_url(
'http://10.0.1.5',
'2013-03-22',
'user-data'
),
'http://10.0.1.5/2013-03-22/user-data/'
)




if __name__ == '__main__': if __name__ == '__main__':
Expand Down

0 comments on commit 302ebc8

Please sign in to comment.