I think the juju_info["api-addresses"].split() should me moved inside get_juju_info(), since there are currently two places where the split is performed after getting the info.
As a result this could we written as
+ juju_registration_info = dict(
+ (key, value) for key, value in juju_info
+ if key in ["environment-uuid", "api-addresses", "unit-name"])
+1, looks good!
#1: on_info = {} on_info[ "environment- uuid"] = juju_info[ on_info[ "api-addresses" ] = juju_info[ ].split( ) on_info[ "unit-name" ] = juju_info[ "unit-name" ]
+ juju_registrati
+ juju_registrati
+ "environment-uuid"]
+ juju_registrati
+ "api-addresses"
+ juju_registrati
I think the juju_info[ "api-addresses" ].split( ) should me moved inside get_juju_info(), since there are currently two places where the split is performed after getting the info.
As a result this could we written as
+ juju_registrati on_info = dict( uuid", "api-addresses", "unit-name"])
+ (key, value) for key, value in juju_info
+ if key in ["environment-
#2:
+import os.path
Please use "from os import path" instead.
#3: LandscapeTest) :
+class JujuTest(
Tests in this class don't have docstrings.
#4: l("DEAD- BEEF", juju_info[ "environment- uuid"]) l("juju- unit-name" , juju_info[ "unit-name" ]) l("10.0. 3.1:17070" , juju_info[ "api-addresses" ]) l("127. 0.0.1", juju_info[ "private- address" ])
+ self.assertEqua
+ self.assertEqua
+ self.assertEqua
+ self.assertEqua
It'd be better to compare juju_info with an expected dict, to ensure there are no extra keys.