Exemple #1
0
    def test_http_wrong_status_issue_collection(self):
        """Test if an empty collection is returned when the http status is not 200"""

        client = LaunchpadClient("mydistribution",
                                 consumer_key=CONSUMER_KEY,
                                 api_token=OAUTH_TOKEN,
                                 package="mypackage")
        with self.assertRaises(requests.exceptions.HTTPError):
            _ = next(client.issue_collection("100", "attachments"))
    def test_http_wrong_status_issue_collection(self):
        """Test if an empty collection is returned when the http status is not 200"""

        httpretty.register_uri(httpretty.GET,
                               LAUNCHPAD_API_URL + "/bugs/100/attachments",
                               body="",
                               status=404)

        client = LaunchpadClient("mydistribution", package="mypackage")
        with self.assertRaises(requests.exceptions.HTTPError):
            _ = next(client.issue_collection("100", "attachments"))