From 7595011cbb78c84f47ec169586c7cf5da6c16ade Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Wed, 4 Nov 2015 23:43:35 +0800 Subject: [PATCH 1/2] Add a testcase for Regex --- tests/test_regex.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/test_regex.py diff --git a/tests/test_regex.py b/tests/test_regex.py new file mode 100644 index 0000000..1ea4348 --- /dev/null +++ b/tests/test_regex.py @@ -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") From d77cff9cc75b949b63d9497db54a5d86aabf9281 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Wed, 4 Nov 2015 23:44:23 +0800 Subject: [PATCH 2/2] Add a testcase for Manual --- tests/test_manual.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/test_manual.py diff --git a/tests/test_manual.py b/tests/test_manual.py new file mode 100644 index 0000000..87f79f5 --- /dev/null +++ b/tests/test_manual.py @@ -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")