Exemple #1
0
    def test_url_with_trailing_spaces(self):
        ''' Should remove trailing spaces.  '''

        self.assertEqual(
            self.http_url,
            gettitle.check_and_reconstruct_url("http://google.com   ")
        )
        self.assertEqual(
            self.https_url,
            gettitle.check_and_reconstruct_url("https://google.com   ")
        )
Exemple #2
0
    def test_correct_url(self):
        ''' Should return same url if the input url is correct. '''

        self.assertEqual(
            self.http_url,
            gettitle.check_and_reconstruct_url(self.http_url)
        )
        self.assertEqual(
            self.https_url,
            gettitle.check_and_reconstruct_url(self.https_url)
        )
Exemple #3
0
    def test_broken_scheme_url(self):
        ''' Should replace scheme which is not http or https to http '''

        self.assertEqual(
            self.http_url,
            gettitle.check_and_reconstruct_url("ttp://google.com")
        )