Example #1
0
 def test_parsed_query(self):
     uri_string = "http://foo:80/?foo=bar"
     uri = RedirectURI(uri_string, self.oauth_settings)
     self.assertEqual(
         uri.parsed_query()["foo"],
         "bar",
         "check that the value is not a list since parseqs seems hellbent on making it one",
     )
Example #2
0
    def test_is_absolute(self):
        uri = RedirectURI("http://foo/bar", self.oauth_settings)
        self.assertTrue(uri.is_absolute())

        uri = RedirectURI("http://", self.oauth_settings)
        self.assertFalse(uri.is_absolute())

        uri = RedirectURI("//foo", self.oauth_settings)
        self.assertFalse(uri.is_absolute())
Example #3
0
 def test_get_url(self):
     uri_string = "http://foo:80/"
     uri = RedirectURI(uri_string, self.oauth_settings)
     self.assertEqual(uri.get_url(), uri_string)