def test_is_subdomain(): from pajbot.modules.linkchecker import is_subdomain assert is_subdomain("pajlada.se", "pajlada.se") assert is_subdomain("test.pajlada.se", "pajlada.se") assert not is_subdomain("test.pajlada.se", "pajlada.com") assert not is_subdomain("kastaren.com", "roleplayer.se") assert not is_subdomain("foo.bar.com", "foobar.com")
def test_is_subdomain(self): from pajbot.modules.linkchecker import is_subdomain self.assertTrue(is_subdomain('pajlada.se', 'pajlada.se')) self.assertTrue(is_subdomain('test.pajlada.se', 'pajlada.se')) self.assertFalse(is_subdomain('test.pajlada.se', 'pajlada.com')) self.assertFalse(is_subdomain('kastaren.com', 'roleplayer.se')) self.assertFalse(is_subdomain('foo.bar.com', 'foobar.com'))