コード例 #1
0
    def test_list_in_progress(self, request):
        resp = create_mock_json('tests/resources/conversations/participant_list.json')
        resp.status_code = 200
        request.return_value = resp

        uri = "{0}/Conversations/{1}".format(BASE_URI, CONVERSATION_SID)
        expected = "{0}/Participants".format(uri)
        list_resource = Participants(uri, AUTH)
        list_resource.list()
        request.assert_called_with("GET", expected, params={}, auth=AUTH, use_json_extension=False)
コード例 #2
0
    def test_get(self, request):
        resp = create_mock_json('tests/resources/conversations/participant_instance.json')
        resp.status_code = 200
        request.return_value = resp

        uri = "{0}/Conversations/{1}".format(BASE_URI, CONVERSATION_SID)
        expected = "{0}/Participants/{1}".format(uri, PARTICIPANT_SID)
        list_resource = Participants(uri, AUTH)
        list_resource.get(PARTICIPANT_SID)
        request.assert_called_with("GET", expected, use_json_extension=False, auth=AUTH)
コード例 #3
0
    def test_get(self, request):
        resp = create_mock_json(
            'tests/resources/conversations/participant_instance.json')
        resp.status_code = 200
        request.return_value = resp

        uri = "{0}/Conversations/{1}".format(BASE_URI, CONVERSATION_SID)
        expected = "{0}/Participants/{1}".format(uri, PARTICIPANT_SID)
        list_resource = Participants(uri, AUTH)
        list_resource.get(PARTICIPANT_SID)
        request.assert_called_with("GET",
                                   expected,
                                   use_json_extension=False,
                                   auth=AUTH)
コード例 #4
0
    def test_list_in_progress(self, request):
        resp = create_mock_json(
            'tests/resources/conversations/participant_list.json')
        resp.status_code = 200
        request.return_value = resp

        uri = "{0}/Conversations/{1}".format(BASE_URI, CONVERSATION_SID)
        expected = "{0}/Participants".format(uri)
        list_resource = Participants(uri, AUTH)
        list_resource.list()
        request.assert_called_with("GET",
                                   expected,
                                   params={},
                                   auth=AUTH,
                                   use_json_extension=False)