|
63 | 63 | "country": "US", |
64 | 64 | "riskFactors": ["FLIGHT_RISK", "HIGH_IMPACT_EMPLOYEE"], |
65 | 65 | } |
| 66 | +TEST_PROFILE_RESPONSE = { |
| 67 | + "userId": "12345-42", |
| 68 | + "tenantId": "SampleTenant1", |
| 69 | + |
| 70 | + "displayName": "Foo Bar", |
| 71 | + "notes": "", |
| 72 | + "managerId": "123-42", |
| 73 | + "managerUsername": "[email protected]", |
| 74 | + "managerDisplayName": "", |
| 75 | + "title": "Engineer", |
| 76 | + "division": "Engineering", |
| 77 | + "department": "RDO", |
| 78 | + "employmentType": "Remote", |
| 79 | + "country": "USA", |
| 80 | + "region": "Minnesota", |
| 81 | + "locality": "Minneapolis", |
| 82 | + "active": True, |
| 83 | + "deleted": False, |
| 84 | + "supportUser": False, |
| 85 | + "startDate": {"year": 2020, "month": 8, "day": 10}, |
| 86 | + "endDate": {"year": 2021, "month": 5, "day": 1}, |
| 87 | + |
| 88 | +} |
| 89 | + |
66 | 90 | TEST_MATTER_RESPONSE = { |
67 | 91 | "legalHolds": [ |
68 | 92 | {"legalHoldUid": "123456789", "name": "Legal Hold #1", "active": True}, |
@@ -615,6 +639,61 @@ def test_show_include_legal_hold_membership_merges_in_and_concats_legal_hold_inf |
615 | 639 | assert "123456789,987654321" in result.output |
616 | 640 |
|
617 | 641 |
|
| 642 | +def test_list_risk_profiles_calls_get_all_user_risk_profiles_with_default_parameters( |
| 643 | + runner, cli_state |
| 644 | +): |
| 645 | + runner.invoke( |
| 646 | + cli, |
| 647 | + ["users", "list-risk-profiles"], |
| 648 | + obj=cli_state, |
| 649 | + ) |
| 650 | + cli_state.sdk.userriskprofile.get_all.assert_called_once_with( |
| 651 | + active=None, manager_id=None, department=None, employment_type=None, region=None |
| 652 | + ) |
| 653 | + |
| 654 | + |
| 655 | +def test_list_risk_profiles_calls_get_all_user_risk_profiles_with_correct_parameters( |
| 656 | + runner, cli_state |
| 657 | +): |
| 658 | + r = runner.invoke( |
| 659 | + cli, |
| 660 | + [ |
| 661 | + "users", |
| 662 | + "list-risk-profiles", |
| 663 | + "--active", |
| 664 | + "--manager-id", |
| 665 | + "123-42", |
| 666 | + "--department", |
| 667 | + "Engineering", |
| 668 | + "--employment-type", |
| 669 | + "Remote", |
| 670 | + "--region", |
| 671 | + "Minnesota", |
| 672 | + ], |
| 673 | + obj=cli_state, |
| 674 | + ) |
| 675 | + print(r.output) |
| 676 | + cli_state.sdk.userriskprofile.get_all.assert_called_once_with( |
| 677 | + active=True, |
| 678 | + manager_id="123-42", |
| 679 | + department="Engineering", |
| 680 | + employment_type="Remote", |
| 681 | + region="Minnesota", |
| 682 | + ) |
| 683 | + |
| 684 | + |
| 685 | +def test_show_risk_profile_calls_user_risk_profile_get_by_username_with( |
| 686 | + runner, cli_state, get_users_response |
| 687 | +): |
| 688 | + runner.invoke( |
| 689 | + cli, |
| 690 | + [ "users", "show-risk-profile", "[email protected]"], |
| 691 | + obj=cli_state, |
| 692 | + ) |
| 693 | + |
| 694 | + cli_state. sdk. userriskprofile. get_by_username. assert_called_once_with( "[email protected]") |
| 695 | + |
| 696 | + |
618 | 697 | def test_add_user_role_adds( |
619 | 698 | runner, cli_state, get_user_id_success, get_available_roles_success |
620 | 699 | ): |
|
0 commit comments