예제 #1
0
    def test_subscriptions(self):
        """Test whether the method subscriptions works properly"""

        setup_http_server()

        client = GroupsioClient('beta+api', self.tmp_path, '*****@*****.**', 'aaaaa', verify=False)
        subs = [subs for subs in client.subscriptions(per_page=1)]
        self.assertEqual(len(subs), 2)
예제 #2
0
    def test_subscriptions_http_error(self):
        """Test whether HTTP errors are thrown"""

        setup_http_server(http_status_subscriptions=400)

        client = GroupsioClient('beta+api', self.tmp_path, '*****@*****.**', 'aaaaa', verify=False)

        with self.assertRaises(requests.exceptions.HTTPError):
            _ = [subs for subs in client.subscriptions(per_page=1)]