def test_cloud(self, config_module): config_proxy = ConfigProxy() config_module.return_value.CLOUDS = { 'foo': sentinel.foo, 'bar': sentinel.bar, } assert config_proxy.get_cloud() is sentinel.foo
def test_region(self): config_proxy = ConfigProxy() assert config_proxy.REGION is sentinel.region
def test_cloud_missing(self, config_module): config_proxy = ConfigProxy() config_module.return_value.CLOUDS = {} with pytest.raises(ConfigurationError): config_proxy.get_cloud()
def test_sizes_missing(self, config_module): config_proxy = ConfigProxy() config_module.return_value = types.ModuleType(name='config') with pytest.raises(ConfigurationError): config_proxy.SIZES
def test_sizes(self, config_module): config_proxy = ConfigProxy() config_module.return_value.SIZES = sentinel.sizes assert config_proxy.SIZES is sentinel.sizes
def test_clouds(self, config_module): config_proxy = ConfigProxy() config_module.return_value.CLOUDS = sentinel.clouds assert config_proxy.CLOUDS is sentinel.clouds
def test_cloud_missing(self, config_module): config_proxy = ConfigProxy() config_module.return_value.CLOUDS = { } with pytest.raises(ConfigurationError): config_proxy.get_cloud()
def test_clouds_missing(self, config_module): config_proxy = ConfigProxy() config_module.return_value = types.ModuleType(name='config') with pytest.raises(ConfigurationError): config_proxy.get_cloud()