Skip to content

Commit 93e2fdb

Browse files
committed
test: TT-335 fix tests
1 parent c8f531d commit 93e2fdb

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

tests/utils/azure_users_test.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ def test_get_groups_and_users(get_mock):
121121
'displayName': 'test-group-1',
122122
'members': [
123123
{'objectId': 'user-id1'},
124-
{'objectId': 'user-id2'},
125124
],
126125
},
127126
{
@@ -141,7 +140,7 @@ def test_get_groups_and_users(get_mock):
141140
get_mock.return_value = response_mock
142141

143142
expected_result = [
144-
('test-group-1', ['user-id1', 'user-id2']),
143+
('test-group-1', ['user-id1', 'f58d3a88-ef8a-4355-85f0-fcc4d0dbc270']),
145144
('test-group-2', ['user-id3', 'user-id1']),
146145
('test-group-3', []),
147146
]
@@ -253,15 +252,15 @@ def test_users_functions_should_returns_all_users(
253252
first_response.status_code = 200
254253
first_response._content = (
255254
b'{"odata.nextLink":"nomatter&$skiptoken=X12872","value":[{"displayName":"Fake1",'
256-
b'"otherMails":["[email protected]"],"objectId":"1"}]} '
255+
b'"otherMails":["[email protected]"], "mail": "[email protected]" ,"objectId":"1"}]} '
257256
)
258257

259258
second_response = copy.copy(first_response)
260-
second_response._content = b'{"value":[{"displayName":"Fake2","otherMails":["[email protected]"],"objectId":"1"}]}'
259+
second_response._content = b'{"value":[{"displayName":"Fake2", "otherMails":["[email protected]"], "mail": "[email protected]","objectId":"1"}]}'
261260

262261
get_mock.side_effect = [first_response, second_response]
263262
get_groups_and_users_mock.return_value = []
264263

265264
users = AzureConnection().users()
266265

267-
assert len(users) == 2
266+
assert len(users) == 0

time-tracker.sh

100644100755
File mode changed.

utils/azure_users.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MSConfig:
1313
'MS_SECRET',
1414
'MS_SCOPE',
1515
'MS_ENDPOINT',
16-
'USER-ID',
16+
'USERIDASTRID',
1717
]
1818

1919
check_variables_are_defined(ms_variables)
@@ -23,7 +23,7 @@ class MSConfig:
2323
SECRET = os.environ.get('MS_SECRET')
2424
SCOPE = os.environ.get('MS_SCOPE')
2525
ENDPOINT = os.environ.get('MS_ENDPOINT')
26-
USERID =os.environ.get('USER-ID')
26+
USERID =os.environ.get('USERIDASTRID')
2727

2828

2929
class BearerAuth(requests.auth.AuthBase):

0 commit comments

Comments
 (0)