Kaynağa Gözat

Create basic test to fake_user_agent

pull/3011/head
Matheus Felipe 2 yıl önce
ebeveyn
işleme
1866c0d83a
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: AA785C523274872F
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  1. +5
    -0
      scripts/tests/test_validate_links.py

+ 5
- 0
scripts/tests/test_validate_links.py Dosyayı Görüntüle

@@ -3,6 +3,7 @@
import unittest import unittest


from validate.links import find_links_in_text from validate.links import find_links_in_text
from validate.links import fake_user_agent
from validate.links import get_host_from_link from validate.links import get_host_from_link
from validate.links import has_cloudflare_protection from validate.links import has_cloudflare_protection


@@ -63,6 +64,10 @@ class TestValidateLinks(unittest.TestCase):
find_links_in_text(1) find_links_in_text(1)
find_links_in_text(True) find_links_in_text(True)
def test_if_fake_user_agent_has_a_str_as_return(self):
user_agent = fake_user_agent()
self.assertIsInstance(user_agent, str)

def test_get_host_from_link(self): def test_get_host_from_link(self):
links = [ links = [
'example.com', 'example.com',


Yükleniyor…
İptal
Kaydet