def test_env_from_config(self):
     """ Test that we can use a custom environment that is stored
     in the config
     """
     config = CLIConfig()
     env = brkt_cli.brkt_env_from_domain('foo.com')
     config.set_env('test', env)
     config.set_current_env('test')
     for mode in (INSTANCE_CREATOR_MODE, INSTANCE_UPDATER_MODE):
         brkt_config = _get_brkt_config_for_cli_args(
             mode=mode, cli_config=config)
         for attr in ('api', 'hsmproxy', 'network'):
             endpoint = '%s:%d' % (
                 getattr(env, attr + '_host'),
                 getattr(env, attr + '_port'))
             self.assertEqual(endpoint, brkt_config.get(attr + '_host'))