File: webpump_test.py

package info (click to toggle)
python-pypump 0.7-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 560 kB
  • sloc: python: 3,153; makefile: 134
file content (19 lines) | stat: -rw-r--r-- 609 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from __future__ import absolute_import

import six
from six.moves.urllib import parse

from tests import PyPumpTest


class WebPumpTest(PyPumpTest):
    """ Tests to ensure the WebPump works as it should do """
    def test_url_is_set(self):
        """ Tests that URL is provided with token for OAuth """
        self.assertTrue(isinstance(self.webpump.url, six.string_types))

        url = parse.urlparse(self.webpump.url)
        query = parse.parse_qs(url.query)

        self.assertEqual(url.netloc, self.webpump.client.webfinger.split("@", 1)[1])
        self.assertEqual(url.path, "/oauth/authorize")