Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding test for pypi upload token #170

Merged
merged 7 commits into from
Oct 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions tests/test_regex_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def test_lat_long6():

def test_ip():
res = r.check(
["http://10.1.1.1/just/a/test"], boundaryless=Filter({"Tags": ["Identifiers"]})
["http://10.1.1.1/just/a/test"],
boundaryless=Filter({"Tags": ["Identifiers"]}),
)
_assert_match_first_item("Uniform Resource Locator (URL)", res)
assert "Internet Protocol (IP) Address Version 4" in res[1]["Regex Pattern"]["Name"]
Expand Down Expand Up @@ -355,7 +356,8 @@ def test_email2():

def test_email3():
res = r.check(
["john.smith@[123.123.123.123]"], boundaryless=Filter({"Tags": ["Identifiers"]})
["john.smith@[123.123.123.123]"],
boundaryless=Filter({"Tags": ["Identifiers"]}),
)
assert "Email Address" in res[2]["Regex Pattern"]["Name"]

Expand Down Expand Up @@ -803,6 +805,15 @@ def test_new_relic_user_api_key():
_assert_match_first_item("New Relic User API Key", res)


def test_pypi_upload_token():
res = r.check(
[
"pypi-AgEIcHlwaS5vcmcCJDZlNzEyNGJmLWQ4N2UtNGZhYS1iNWEzLWQzYzg2YjU3NzAxYgACJXsicGVybWlzc2lvbnMiOiAidXNlciIsICJ2ZXJzaW9uIjogMX0AAAYgeYcgrZO31PTS_3ipsd0fTSMy1kVkxCzhQvHN6m97yIE"
]
)
_assert_match_first_item("PyPi Upload Token", res)


def test_turkish_car_plate():
res = r.check(["34A2344"])
_assert_match_first_item("Turkish License Plate Number", res)
Expand Down