mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
Merge pull request #26 from felixonmars/tests
Testcases for Regex and Manual
This commit is contained in:
commit
f924b973d4
2 changed files with 16 additions and 0 deletions
6
tests/test_manual.py
Normal file
6
tests/test_manual.py
Normal 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
10
tests/test_regex.py
Normal 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")
|
Loading…
Add table
Reference in a new issue