Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 6
0
    def test_find_no_urls(self):
        text = "Move along... https:// Nothing to see..."
        urls = util.find_urls(text)

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

        self.assertEqual([], urls)