Abstracted #1383 & added tests. #1406

Closed
wants to merge 3 commits into
from

Projects

None yet

2 participants

@toastdriven

Expands on the work done in #1383, applies it to all the metadata functions (including the one that was hardcoded regardless of the params passed in) & added tests for the new private function.

@jamesls jamesls commented on an outdated diff Mar 22, 2013
tests/unit/utils/test_utils.py
@@ -105,5 +106,23 @@ def test_string_with_numbers(self):
self.assertEqual(pythonize_name('HTTPStatus200Ok'), 'http_status_200_ok')
+class TestBuildInstanceMetadataURL(unittest.TestCase):
+ def test_normal(self):
+ # 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/')
@jamesls
jamesls Mar 22, 2013

pep8 < 80 chars

@jamesls jamesls added a commit that closed this pull request Mar 27, 2013
@jamesls jamesls Merge branch 'toastdriven-instance-metadata-urls' into develop
Closes #1406 and #1383.

* toastdriven-instance-metadata-urls:
  Made the tests comply with 80 char lengths per @jamesls's request.
  Abstracted some of #1383 & added tests.
  mod utils.py:get_instance_metadata allowing access to dynamic data
906db3e
@jamesls jamesls closed this in 906db3e Mar 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment