-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from Acurisu/json_serialization_minor_refacto…
…ring remove unused code/imports as well as some reformatting
- Loading branch information
Showing
9 changed files
with
65 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,45 @@ | ||
import json | ||
|
||
import pytest | ||
|
||
url: str = "https://graph.microsoft.com/v1.0/$metadata#users/$entity" | ||
|
||
|
||
@pytest.fixture | ||
def user1_json(): | ||
return '{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ | ||
'"office_location": "dunhill", '\ | ||
'"updated_at": "2021-07-29T03:07:25Z", '\ | ||
'"birthday": "2000-09-04", '\ | ||
'"business_phones": ["+1 205 555 0108"], '\ | ||
'"mobile_phone": null, '\ | ||
'"is_active": true, '\ | ||
'"additional_data": {"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity", '\ | ||
'"manager": {"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ | ||
'"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, '\ | ||
'"approvers": [{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ | ||
'"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, '\ | ||
'{"display_name": "John Doe", "age": 32}], '\ | ||
'"data": {'\ | ||
'"groups": ['\ | ||
'{"friends": [{"display_name": "John Doe", "age": 32}]}'\ | ||
']'\ | ||
'}}}'\ | ||
|
||
|
||
@pytest.fixture | ||
def user2_json(): | ||
|
||
return '{"id": 2, "display_name": "MOD Administrator", "age": 32, "gpa": 3.9}' | ||
return ( | ||
'{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", ' | ||
'"office_location": "dunhill", ' | ||
'"updated_at": "2021-07-29T03:07:25Z", ' | ||
'"birthday": "2000-09-04", ' | ||
'"business_phones": ["+1 205 555 0108"], ' | ||
'"mobile_phone": null, ' | ||
'"is_active": true, ' | ||
'"additional_data": {"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity", ' | ||
'"manager": {"id": "8f841f30-e6e3-439a-a812-ebd369559c36", ' | ||
'"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, ' | ||
'"approvers": [{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", ' | ||
'"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, ' | ||
'{"display_name": "John Doe", "age": 32}], ' | ||
'"data": {' | ||
'"groups": [' | ||
'{"friends": [{"display_name": "John Doe", "age": 32}]}' | ||
"]" | ||
"}}}" | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def users_json(): | ||
return '[{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ | ||
'"office_location": "dunhill", '\ | ||
'"updated_at": "2021-07-29T03:07:25Z", '\ | ||
'"birthday": "2000-09-04", '\ | ||
'"business_phones": ["+1 205 555 0108"], '\ | ||
'"mobile_phone": null, '\ | ||
'"is_active": true}, '\ | ||
'{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ | ||
'"office_location": "dunhill", '\ | ||
'"updated_at": "2021-07-29T03:07:25Z", '\ | ||
'"birthday": "2000-09-04", '\ | ||
'"business_phones": ["+1 205 555 0108"], '\ | ||
'"mobile_phone": null, '\ | ||
'"is_active": true}]' | ||
|
||
|
||
@pytest.fixture | ||
def sample_entity_json(): | ||
|
||
entity_json = json.dumps( | ||
{ | ||
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#$entity", | ||
"id": "8f841f30-e6e3-439a-a812-ebd369559c36" | ||
} | ||
return ( | ||
'[{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", ' | ||
'"office_location": "dunhill", ' | ||
'"updated_at": "2021-07-29T03:07:25Z", ' | ||
'"birthday": "2000-09-04", ' | ||
'"business_phones": ["+1 205 555 0108"], ' | ||
'"mobile_phone": null, ' | ||
'"is_active": true}, ' | ||
'{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", ' | ||
'"office_location": "dunhill", ' | ||
'"updated_at": "2021-07-29T03:07:25Z", ' | ||
'"birthday": "2000-09-04", ' | ||
'"business_phones": ["+1 205 555 0108"], ' | ||
'"mobile_phone": null, ' | ||
'"is_active": true}]' | ||
) | ||
return entity_json |
2 changes: 0 additions & 2 deletions
2
packages/serialization/json/tests/unit/test_intersection_wrapper.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters