def test_get_configured_provider_should_pass_expected_args( active_provider, fake_conf_provider): """ gce delegates the behavior to config.is_provider_configured, and should pass on expected args. """ provider_name, expected_provider = active_provider with patch( "salt.cloud.clouds.gce._get_active_provider_name", autospec=True, return_value=provider_name, ): gce.get_configured_provider() fake_conf_provider.assert_called_with( gce.__opts__, expected_provider, ("project", "service_account_email_address", "service_account_private_key"), )
def test_get_configured_provider_should_return_expected_result( fake_conf_provider): """ Currently get_configured_provider should simply return whatever comes back from config.is_provider_configured, no questions asked. """ expected_result = object() fake_conf_provider.return_value = expected_result actual_result = gce.get_configured_provider() assert actual_result is expected_result
def test_provider_matches(self): """ Test that the first configured instance of a gce driver is matched """ p = gce.get_configured_provider() self.assertNotEqual(p, None)
def test_provider_matches(): """ Test that the first configured instance of a gce driver is matched """ p = gce.get_configured_provider() assert p is not None