예제 #1
0
    def test_mailing_list_url(self):
        """Test whether it returns the URL of a mailing list in Gmane"""

        setup_http_server()

        client = GmaneClient()

        url = client.mailing_list_url('*****@*****.**')
        self.assertEqual(url, GMANE_MYLIST_URL)
예제 #2
0
    def test_mailing_list_url(self):
        """Test whether it returns the URL of a mailing list in Gmane"""

        setup_http_server()

        client = GmaneClient()

        url = client.mailing_list_url('*****@*****.**')
        self.assertEqual(url, GMANE_MYLIST_URL)
예제 #3
0
    def test_mailing_list_url_not_found(self):
        """Test whether it raises an exception when a mailing list is not found"""

        httpretty.register_uri(httpretty.GET, GMANE_INVALID_LIST_URL,
                               status=200,
                               body="No such list")

        client = GmaneClient()

        with self.assertRaises(RepositoryError):
            client.mailing_list_url('*****@*****.**')
예제 #4
0
    def test_mailing_list_url_not_found(self):
        """Test whether it raises an exception when a mailing list is not found"""

        httpretty.register_uri(httpretty.GET,
                               GMANE_INVALID_LIST_URL,
                               status=200,
                               body="No such list")

        client = GmaneClient()

        with self.assertRaises(RepositoryError):
            client.mailing_list_url('*****@*****.**')
예제 #5
0
    def test_messages(self):
        """Test if a set of messages is fetched"""

        body = read_file('data/gmane_messages.mbox', 'rb')

        url = GMAME_DOWNLOAD_LIST_URL + '/888/898'

        httpretty.register_uri(httpretty.GET, url, status=200, body=body)

        client = GmaneClient()

        response = client.messages('gmane.comp.example.mylist', 888, 10)
        self.assertEqual(response, body)
예제 #6
0
    def test_messages(self):
        """Test if a set of messages is fetched"""

        body = read_file('data/gmane_messages.mbox', 'rb')

        url = GMAME_DOWNLOAD_LIST_URL + '/888/898'

        httpretty.register_uri(httpretty.GET, url,
                               status=200,
                               body=body)

        client = GmaneClient()

        response = client.messages('gmane.comp.example.mylist', 888, 10)
        self.assertEqual(response, body)