2014-05-01 22:41:54 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
# ex:ts=4:sw=4:sts=4:et
|
|
|
|
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
# The unittest framwork doesn't play nice with pylint:
|
|
|
|
# pylint: disable-msg=C0103
|
|
|
|
|
2015-09-15 20:10:32 +02:00
|
|
|
|
2019-08-25 00:27:31 +02:00
|
|
|
class HandlesURLsTestMixin:
|
2014-05-01 22:41:54 +02:00
|
|
|
"""
|
|
|
|
This should only be inherited from classes which also inherit
|
|
|
|
a unittest compatible base class.
|
|
|
|
"""
|
2019-08-25 00:27:31 +02:00
|
|
|
|
2016-04-03 19:06:45 +02:00
|
|
|
# pylint: disable-msg=no-init
|
2014-05-01 22:41:54 +02:00
|
|
|
|
|
|
|
def test_handles_urls(self):
|
2019-08-25 00:27:31 +02:00
|
|
|
if len(self.urls["ok"]) > 0:
|
|
|
|
for url in self.urls["ok"]:
|
2014-05-01 22:41:54 +02:00
|
|
|
self.assertTrue(self.service.handles(url))
|
|
|
|
|
2019-08-25 00:27:31 +02:00
|
|
|
if len(self.urls["bad"]) > 0:
|
|
|
|
for url in self.urls["bad"]:
|
2014-05-01 22:41:54 +02:00
|
|
|
self.assertFalse(self.service.handles(url))
|