Merge pull request #26 from felixonmars/tests

Testcases for Regex and Manual
This commit is contained in:
依云 2015-11-05 00:08:24 +08:00
commit f924b973d4
2 changed files with 16 additions and 0 deletions

6
tests/test_manual.py Normal file
View file

@ -0,0 +1,6 @@
from tests.helper import ExternalVersionTestCase
class ManualTest(ExternalVersionTestCase):
def test_manual(self):
self.assertEqual(self.sync_get_version("example", {"manual": "Meow"}), "Meow")

10
tests/test_regex.py Normal file
View file

@ -0,0 +1,10 @@
from tests.helper import ExternalVersionTestCase
class RegexTest(ExternalVersionTestCase):
def test_regex(self):
self.assertEqual(self.sync_get_version("example", {
"url": "https://httpbin.org/get",
"regex": '"User-Agent": "(\w+)"',
"user_agent": "Meow",
}), "Meow")