8000 fix test error messages · CyberSys/firebase-admin-python@c67e047 · GitHub
[go: up one dir, main page]

Skip to content

Commit c67e047

Browse files
committed
fix test error messages
1 parent ba9d8f4 commit c67e047

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

firebase_admin/multi_factor_config_mgt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def validate(self):
117117
# pylint: disable=C0123
118118
if type(self.adjacent_intervals) is not int:
119119
raise ValueError(
120-
'TOTPProviderConfig.adjacent_intervals must be an integer between'
120+
'totp_provider_config.adjacent_intervals must be an integer between'
121121
' 1 and 10 (inclusive).')
122122
if not 1 <= self.adjacent_intervals <= 10:
123123
raise ValueError(
@@ -209,11 +209,11 @@ def validate(self):
209209
'multi_factor_config.provider_configs must be specified')
210210
if not isinstance(self.provider_configs, list) or not self.provider_configs:
211211
raise ValueError(
212-
'provider_configs must be an array of type ProviderConfigs.')
212+
'provider_configs must be an array of type ProviderConfig.')
213213
for provider_config in self.provider_configs:
214214
if not isinstance(provider_config, ProviderConfig):
215215
raise ValueError(
216-
'provider_configs must be an array of type ProviderConfigs.')
216+
'provider_configs must be an array of type ProviderConfig.')
217217
provider_config.validate()
218218

219219
def build_server_request(self):

tests/test_multi_factor_config.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_invalid_provider_configs_type(self, provider_configs):
4444
with pytest.raises(ValueError) as excinfo:
4545
test_config.build_server_request()
4646
assert str(excinfo.value).startswith('provider_configs must be an array of type'
47-
' ProviderConfigs.')
47+
' ProviderConfig.')
4848

4949
@pytest.mark.parametrize('provider_configs',
5050
[[True], [1, 2],
@@ -55,7 +55,7 @@ def test_invalid_mfa_config_provider_config(self, provider_configs):
5555
with pytest.raises(ValueError) as excinfo:
5656
test_config.build_server_request()
5757
assert str(excinfo.value).startswith('provider_configs must be an array of type'
58-
' ProviderConfigs.')
58+
' ProviderConfig.')
5959

6060

6161
class TestProviderConfig:
@@ -73,7 +73,7 @@ def test_undefined_provider_config_state(self):
7373
with pytest.raises(ValueError) as excinfo:
7474
test_config.build_server_request()
7575
assert str(excinfo.value).startswith(
76-
'provider_config.state must be defined.')
76+
'ProviderConfig.state must be defined.')
7777

7878
@pytest.mark.parametrize('state',
7979
['', 1, True, False, [], (), {}, "foo", 'ENABLED'])
@@ -83,7 +83,7 @@ def test_invalid_provider_config_state(self, state):
8383
)
8484
with pytest.raises(ValueError) as excinfo:
8585
test_config.build_server_request()
86-
assert str(excinfo.value).startswith('provider_config.state must be of type'
86+
assert str(excinfo.value).startswith('ProviderConfig.state must be of type'
8787
' ProviderConfig.State.')
8888

8989
@pytest.mark.parametrize('state',
@@ -93,7 +93,7 @@ def test_undefined_totp_provider_config(self, state):
9393
test_config = multi_factor_config_mgt.ProviderConfig(state=state)
9494
with pytest.raises(ValueError) as excinfo:
9595
test_config.build_server_request()
96-
assert str(excinfo.value).startswith('provider_config.totp_provider_config must be'
96+
assert str(excinfo.value).startswith('ProviderConfig.totp_provider_config must be'
9797
' defined.')
9898

9999
@pytest.mark.parametrize('totp_provider_config',
@@ -103,7 +103,7 @@ def test_invalid_totp_provider_config_type(self, totp_provider_config):
103103
test_config.totp_provider_config = totp_provider_config
104104
with pytest.raises(ValueError) as excinfo:
105105
test_config.build_server_request()
106-
assert str(excinfo.value).startswith('provider_configs.totp_provider_config must be of type'
106+
assert str(excinfo.value).startswith('ProviderConfig.totp_provider_config must be of type'
107107
' TOTPProviderConfig.')
108108

109109

0 commit comments

Comments
 (0)
0