예제 #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
예제 #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)
예제 #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)
예제 #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
예제 #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)
예제 #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
예제 #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)