Example #1
0
    def test_get_task_information(self):
        client = BoxClient("my_token")

        response = {"type": "task", "id": 123}

        (
            flexmock(requests)
            .should_receive("request")
            .with_args(
                "get", "https://api.box.com/2.0/tasks/123", params=None, data=None, headers=client.default_headers
            )
            .and_return(mocked_response(response))
        )

        task = client.get_task_information(123)
        self.assertEquals(task, response)
Example #2
0
    def test_get_task_information(self):
        client = BoxClient("my_token")

        response = {"type": "task",
                    "id": 123
        }

        (flexmock(requests)
            .should_receive('request')
            .with_args("get",
                 "https://api.box.com/2.0/tasks/123",
                 params=None,
                 data=None,
                 headers=client.default_headers)
        .and_return(mocked_response(response)))

        task = client.get_task_information(123)
        self.assertEquals(task, response)