def test_find_in_go_does_not_crash_with_unicode_error(self):
     test_file = self.get_test_loc('finder/url/verify.go')
     patterns = [(
         'urls',
         urls_regex(),
     )]
     for _key, url, _line, _lineno in find(test_file, patterns):
         assert type(url) == compat.unicode
Example #2
0
 def test_urls_regex(self):
     test_file = self.get_test_loc('finder/url/BeautifulSoup.py')
     test_input = open(test_file).read()
     expected = [
         u'http://www.crummy.com/software/BeautifulSoup/',
         u'http://chardet.feedparser.org/',
         u'http://cjkpython.i18n.org/',
         u'http://www.crummy.com/software/BeautifulSoup/documentation.html',
         u'http://chardet.feedparser.org/',
         u'http://cjkpython.i18n.org/',
     ]
     assert expected == re.findall(finder.urls_regex(), test_input)
 def test_urls_regex(self):
     test_file = self.get_test_loc('finder/url/BeautifulSoup.py')
     test_input = open(test_file).read()
     expected = [
         u'http://www.crummy.com/software/BeautifulSoup/',
         u'http://chardet.feedparser.org/',
         u'http://cjkpython.i18n.org/',
         u'http://www.crummy.com/software/BeautifulSoup/documentation.html',
         u'http://chardet.feedparser.org/',
         u'http://cjkpython.i18n.org/',
     ]
     assert expected == re.findall(finder.urls_regex(), test_input)
Example #4
0
 def test_urls_regex_without_http(self):
     result = re.match(finder.urls_regex(),
                     u'www.something.domain.tld').group()
     expected = u'www.something.domain.tld'
     assert expected == result
 def test_urls_regex_without_http(self):
     test = re.match(finder.urls_regex(),
                     u'www.something.domain.tld').group()
     expected = u'www.something.domain.tld'
     self.assertEqual(expected, test)
 def test_urls_regex_without_http(self):
     result = re.match(finder.urls_regex(),
                     u'www.something.domain.tld').group()
     expected = u'www.something.domain.tld'
     assert expected == result
 def test_urls_regex_without_http(self):
     test = re.match(finder.urls_regex(),
                     u'www.something.domain.tld').group()
     expected = u'www.something.domain.tld'
     self.assertEqual(expected, test)