Example #1
0
    def test_find_urls(self):
        text = "<i>http://google.com/something</b>" " and >+https://maps.yandex.ru<a> "
        urls = util.find_urls(text)

        self.assertEqual(2, len(urls))
        self.assertIn("http://google.com/something", urls)
        self.assertIn("https://maps.yandex.ru", urls)
Example #2
0
    def test_find_urls(self):
        text = "<i>http://google.com/something</b>" \
               " and >+https://maps.yandex.ru<a> "
        urls = util.find_urls(text)

        self.assertEqual(2, len(urls))
        self.assertIn('http://google.com/something', urls)
        self.assertIn('https://maps.yandex.ru', urls)
Example #3
0
def extract_urls(text):
    iso, torrent = None, None
    if text:
        urls = util.find_urls(text)
        iso = util.try_index(urls, 0)
        torrent = util.try_index(urls, 1)

    return iso, torrent
Example #4
0
def find_bugs(build):
    descr = build['description']
    if not descr:
        return []

    urls = util.find_urls(descr)
    bugs = [re.findall(r"\d{7}", x) for x in urls]
    if not bugs:
        return bugs

    bugs = sum(bugs, [])
    bugs = map(int, bugs)
    bugs = list(set(bugs))

    return bugs
Example #5
0
def find_bugs(build):
    descr = build['description']
    if not descr:
        return []

    urls = util.find_urls(descr)
    bugs = [re.findall(r"\d{7}", x) for x in urls]
    if not bugs:
        return bugs

    bugs = sum(bugs, [])
    bugs = map(int, bugs)
    bugs = list(set(bugs))

    return bugs
Example #6
0
    def test_find_no_urls(self):
        text = "Move along... https:// Nothing to see..."
        urls = util.find_urls(text)

        self.assertEqual([], urls)
Example #7
0
    def test_find_no_urls(self):
        text = "Move along... https:// Nothing to see..."
        urls = util.find_urls(text)

        self.assertEqual([], urls)