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
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
2015-09-15 20:10:32 +02:00
|
|
|
|
2014-05-01 22:41:54 +02:00
|
|
|
class HandlesURLsTestMixin():
|
|
|
|
"""
|
|
|
|
This should only be inherited from classes which also inherit
|
|
|
|
a unittest compatible base class.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def test_handles_urls(self):
|
|
|
|
if len(self.urls['ok']) > 0:
|
|
|
|
for url in self.urls['ok']:
|
|
|
|
self.assertTrue(self.service.handles(url))
|
|
|
|
|
|
|
|
if len(self.urls['bad']) > 0:
|
|
|
|
for url in self.urls['bad']:
|
|
|
|
self.assertFalse(self.service.handles(url))
|