def test_create_from_env_var_factory_method_with_missing_env_values(self): try: ContainerPlatformClient.create_from_env() except ContainerPlatformClientException as expected: self.assertEqual( expected.message, "Required env var 'HPECP_PASSWORD' not found.", )
def test_create_from_env_var_factory_method_with_type_error(self): try: ContainerPlatformClient.create_from_env() except ContainerPlatformClientException as expected: self.assertEqual( expected.message, "invalid literal for int() with base 10: 'not_an_int'", )
def test_create_from_env_var_factory_method_with_falses(self): client = ContainerPlatformClient.create_from_env() self.assertEqual(client.username, "test_username") self.assertEqual(client.password, "test_password") self.assertEqual(client.api_host, "test_apihost") self.assertEqual(client.api_port, 8080) self.assertEqual(client.use_ssl, False) self.assertEqual(client.verify_ssl, False) self.assertEqual(client.warn_ssl, False)