Exemplo n.º 1
0
 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
Exemplo n.º 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)
Exemplo n.º 3
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)
Exemplo n.º 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
Exemplo n.º 5
0
 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)
Exemplo n.º 6
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
Exemplo n.º 7
0
 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)