-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
"""JsJaws Service Tests""" | ||
|
||
import os | ||
import shutil | ||
from hashlib import sha256 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Tests for JsJaws regexes, helper functions, etc.""" | ||
|
||
import re | ||
|
||
import pytest | ||
|
||
from jsjaws import JQUERY_VERSION_REGEX | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("header", "version"), | ||
[ | ||
("", None), | ||
("/*!\n * jQuery JavaScript Library v1.5\n", "1.5"), | ||
("/*!\n * jQuery JavaScript Library v3.7.1\n", "3.7.1"), | ||
("/*!\n * jQuery JavaScript Library v3.0.0-alpha1\n", "3.0.0-alpha1"), | ||
("/*!\n * jQuery JavaScript Library v4.0.0-beta.2\n", "4.0.0-beta.2"), | ||
], | ||
) | ||
def test_JQUERY_VERSION_REGEX(header: str, version: str | None): | ||
match = re.match(JQUERY_VERSION_REGEX, header) | ||
if match is None: | ||
assert version is None | ||
else: | ||
assert match.group(1) == version |