diff --git a/firebase_admin/multi_factor_config_mgt.py b/firebase_admin/multi_factor_config_mgt.py index 3db4486d6..f965be8a3 100644 --- a/firebase_admin/multi_factor_config_mgt.py +++ b/firebase_admin/multi_factor_config_mgt.py @@ -117,7 +117,7 @@ def validate(self): # pylint: disable=C0123 if type(self.adjacent_intervals) is not int: raise ValueError( - 'TOTPProviderConfig.adjacent_intervals must be an integer between' + 'totp_provider_config.adjacent_intervals must be an integer between' ' 1 and 10 (inclusive).') if not 1 <= self.adjacent_intervals <= 10: raise ValueError( @@ -209,11 +209,11 @@ def validate(self): 'multi_factor_config.provider_configs must be specified') if not isinstance(self.provider_configs, list) or not self.provider_configs: raise ValueError( - 'provider_configs must be an array of type ProviderConfigs.') + 'provider_configs must be an array of type ProviderConfig.') for provider_config in self.provider_configs: if not isinstance(provider_config, ProviderConfig): raise ValueError( - 'provider_configs must be an array of type ProviderConfigs.') + 'provider_configs must be an array of type ProviderConfig.') provider_config.validate() def build_server_request(self): diff --git a/tests/test_multi_factor_config.py b/tests/test_multi_factor_config.py index b14b395fc..eaf0dcb25 100644 --- a/tests/test_multi_factor_config.py +++ b/tests/test_multi_factor_config.py @@ -44,7 +44,7 @@ def test_invalid_provider_configs_type(self, provider_configs): with pytest.raises(ValueError) as excinfo: test_config.build_server_request() assert str(excinfo.value).startswith('provider_configs must be an array of type' - ' ProviderConfigs.') + ' ProviderConfig.') @pytest.mark.parametrize('provider_configs', [[True], [1, 2], @@ -55,7 +55,7 @@ def test_invalid_mfa_config_provider_config(self, provider_configs): with pytest.raises(ValueError) as excinfo: test_config.build_server_request() assert str(excinfo.value).startswith('provider_configs must be an array of type' - ' ProviderConfigs.') + ' ProviderConfig.') class TestProviderConfig: @@ -73,7 +73,7 @@ def test_undefined_provider_config_state(self): with pytest.raises(ValueError) as excinfo: test_config.build_server_request() assert str(excinfo.value).startswith( - 'provider_config.state must be defined.') + 'ProviderConfig.state must be defined.') @pytest.mark.parametrize('state', ['', 1, True, False, [], (), {}, "foo", 'ENABLED']) @@ -83,7 +83,7 @@ def test_invalid_provider_config_state(self, state): ) with pytest.raises(ValueError) as excinfo: test_config.build_server_request() - assert str(excinfo.value).startswith('provider_config.state must be of type' + assert str(excinfo.value).startswith('ProviderConfig.state must be of type' ' ProviderConfig.State.') @pytest.mark.parametrize('state', @@ -93,7 +93,7 @@ def test_undefined_totp_provider_config(self, state): test_config = multi_factor_config_mgt.ProviderConfig(state=state) with pytest.raises(ValueError) as excinfo: test_config.build_server_request() - assert str(excinfo.value).startswith('provider_config.totp_provider_config must be' + assert str(excinfo.value).startswith('ProviderConfig.totp_provider_config must be' ' defined.') @pytest.mark.parametrize('totp_provider_config', @@ -103,7 +103,7 @@ def test_invalid_totp_provider_config_type(self, totp_provider_config): test_config.totp_provider_config = totp_provider_config with pytest.raises(ValueError) as excinfo: test_config.build_server_request() - assert str(excinfo.value).startswith('provider_configs.totp_provider_config must be of type' + assert str(excinfo.value).startswith('ProviderConfig.totp_provider_config must be of type' ' TOTPProviderConfig.')