Esempio n. 1
0
def test_list_permissions_empty(mock_service):
    service, _ = mock_service("account_get.json", "empty.json")

    account = GTMAccount(path="accounts/1234567", service=service)

    permissions_list = account.list_permissions()
    assert permissions_list == []

    account.list_permissions(refresh=False)
Esempio n. 2
0
def test_list_permissions(mock_service):
    service, responses = mock_service("account_get.json",
                                      "permissions_list.json")
    permissions_list_dict = responses[1]

    account = GTMAccount(path="accounts/1234567", service=service)

    permissions_list = account.list_permissions()
    assert len(permissions_list) == len(
        permissions_list_dict["userPermission"])
    assert isinstance(permissions_list[0], GTMPermission)

    account.list_permissions(refresh=False)