示例#1
0
 def test_password_saved(self):
     """The password is not set when it is not found
     in the metadata service."""
     httpretty.register_uri(httpretty.GET,
                            self.password_url,
                            body="saved_password")
     self.assertFalse(get_password())
示例#2
0
 def test_password(self):
     """The password is set to what is found in the metadata
     service."""
     expected_password = "******"
     httpretty.register_uri(httpretty.GET,
                            self.password_url,
                            body=expected_password)
     password = get_password()
     self.assertEqual(expected_password, password)
示例#3
0
 def test_password_empty(self):
     """No password is set if the metadata service returns
     an empty string."""
     httpretty.register_uri(httpretty.GET, self.password_url, body="")
     self.assertFalse(get_password())