Esempio n. 1
0
    def test_appends_query_param(self):
        gsa = GSA('https://pulpproject.org/search?x=1&y=2')

        url = gsa._form_url('foo')

        # verify that all of the pieces are correct.
        parts = urlparse.urlparse(url)
        self.assertEqual(parts.hostname, 'pulpproject.org')
        self.assertEqual(parts.scheme, 'https')
        self.assertEqual(parts.path, '/search')
        params = urlparse.parse_qs(parts.query)
        self.assertDictEqual(params, {'q': ['foo'], 'x': ['1'], 'y': ['2']})
Esempio n. 2
0
    def test_adds_query_param(self):
        gsa = GSA('http://pulpproject.org/search')

        url = gsa._form_url('foo')

        self.assertEqual(url, 'http://pulpproject.org/search?q=foo')
Esempio n. 3
0
 def setUp(self):
     super(BaseGSATest, self).setUp()
     self.url = 'http://pulpproject.org/search'
     self.gsa = GSA(self.url)