path
stringlengths 9
117
| type
stringclasses 2
values | project
stringclasses 10
values | commit_hash
stringlengths 40
40
| commit_message
stringlengths 1
137
| ground_truth
stringlengths 0
2.74k
| main_code
stringlengths 102
3.37k
| context
stringlengths 0
14.7k
|
---|---|---|---|---|---|---|---|
tests.test_regex_identifier/test_ssh_ecdsa_key
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_ssh_ecdsa_key():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(
<2> [
<3> "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCE9Uli8bGnD4hOWdeo5KKQJ/P/vOazI4MgqJK54w37emP2JwOAOdMmXuwpxbKng3KZz27mz+nKWIlXJ3rzSGMo= r00t@my-random_host"
<4> ]
<5> )
<6> _assert_match_first_item("SSH ECDSA Public Key", res)
<7>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
_assert_match_first_item(name, res)
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_unix_timestamp():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" in keys
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_arn3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_arn2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype/resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_arn():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_s3_internal2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/directory/"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_s3_internal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/key"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_s3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["http://s3.amazonaws.com/bucket/"])
_assert_match_first_item("Amazon Web Services Simple Storage (AWS S3) URL", res)
|
tests.test_regex_identifier/test_ssh_ed25519_key
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(
<2> [
<3> "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
<4> ]
<5> )
<6> _assert_match_first_item("SSH ED25519 Public Key", res)
<7>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
_assert_match_first_item(name, res)
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_unix_timestamp():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" in keys
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_arn3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_arn2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype/resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_arn():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_s3_internal2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/directory/"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_s3_internal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/key"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_s3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["http://s3.amazonaws.com/bucket/"])
_assert_match_first_item("Amazon Web Services Simple Storage (AWS S3) URL", res)
|
tests.test_regex_identifier/test_aws_access_key
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_aws_access_key():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["AKIAIOSFODNN7EXAMPLE"])
<2> assert "Amazon Web Services Access Key" in str(res)
<3>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
_assert_match_first_item(name, res)
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_unix_timestamp():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" in keys
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_arn3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_arn2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype/resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_arn():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_s3_internal2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/directory/"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
|
tests.test_regex_identifier/test_aws_secret_access_key
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
<2> assert "Amazon Web Services Secret Access Key" in str(res)
<3>
|
===========unchanged ref 0===========
at: tests.test_regex_identifier
_assert_match_first_item(name, res)
at: tests.test_regex_identifier.test_slack_token
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_unix_timestamp():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" in keys
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_arn3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_arn2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype/resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_arn():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_s3_internal2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/directory/"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_s3_internal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/key"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_s3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["http://s3.amazonaws.com/bucket/"])
_assert_match_first_item("Amazon Web Services Simple Storage (AWS S3) URL", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_cors():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Access-Control-Allow: *"])
_assert_match_first_item("Access-Control-Allow-Header", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_ssn9():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_ssh_ecdsa_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCE9Uli8bGnD4hOWdeo5KKQJ/P/vOazI4MgqJK54w37emP2JwOAOdMmXuwpxbKng3KZz27mz+nKWIlXJ3rzSGMo= r00t@my-random_host"
]
)
_assert_match_first_item("SSH ECDSA Public Key", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_ssn8():
- r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_ssn7():
- r = regex_identifier.RegexIdentifier()
res = r.check(["666-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_ssn6():
- r = regex_identifier.RegexIdentifier()
res = r.check(["999-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_ssn5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["900-01-2222"])
assert "American Social Security Number" not in str(res)
|
tests.test_regex_identifier/test_aws_ec2_id
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_aws_ec2_id():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["i-1234567890abcdef0"])
<2> assert "Amazon Web Services EC2 Instance identifier" in str(res)
<3>
|
===========unchanged ref 0===========
at: tests.test_regex_identifier
_assert_match_first_item(name, res)
===========unchanged ref 1===========
at: tests.test_regex_identifier.test_pgp_public_key
res = r.check(
[
"-----BEGIN PGP PUBLIC KEY BLOCK-----Comment: Alice's OpenPGP certificateComment: https://www.ietf.org/id/draft-bre-openpgp-samples-01.htmlmDMEXEcE6RYJKwYBBAHaRw8BAQdArjWwk3FAqyiFbFBKT4TzXcVBqPTB3gmzlC/Ub7O1u120JkFsaWNlIExvdmVsYWNlIDxhbGljZUBvcGVucGdwLmV4YW1wbGU+iJAEExYIADgCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQTrhbtfozp14V6UTmPyMVUMT0fjjgUCXaWfOgAKCRDyMVUMT0fjjukrAPoDnHBSogOmsHOsd9qGsiZpgRnOdypvbm+QtXZqth9rvwD9HcDC0tC+PHAsO7OTh1S1TC9RiJsvawAfCPaQZoed8gK4OARcRwTpEgorBgEEAZdVAQUBAQdAQv8GIa2rSTzgqbXCpDDYMiKRVitCsy203x3sE9+eviIDAQgHiHgEGBYIACAWIQTrhbtfozp14V6UTmPyMVUMT0fjjgUCXEcE6QIbDAAKCRDyMVUMT0fjjlnQAQDFHUs6TIcxrNTtEZFjUFm1M0PJ1Dng/cDW4xN80fsn0QEA22Kr7VkCjeAEC08VSTeV+QFsmz55/lntWkwYWhmvOgE==iIGO-----END PGP PUBLIC KEY BLOCK-----"
</s>
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_unix_timestamp():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" in keys
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_arn3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_arn2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype/resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_arn():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_s3_internal2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/directory/"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_s3_internal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/key"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_s3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["http://s3.amazonaws.com/bucket/"])
_assert_match_first_item("Amazon Web Services Simple Storage (AWS S3) URL", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_cors():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Access-Control-Allow: *"])
_assert_match_first_item("Access-Control-Allow-Header", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
|
tests.test_regex_identifier/test_aws_sg_id
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_aws_sg_id():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["sg-6e616f6d69"])
<2> assert "Amazon Web Services EC2 Security Group identifier" in str(res)
<3>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_unix_timestamp():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" in keys
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_arn3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_arn2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype/resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
|
tests.test_regex_identifier/test_aws_org_id
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_aws_org_id():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["o-aa111bb222"])
<2> assert "Amazon Web Services Organization identifier" in str(res)
<3>
|
===========unchanged ref 0===========
at: tests.test_regex_identifier
_assert_match_first_item(name, res)
===========unchanged ref 1===========
at: tests.test_regex_identifier.test_pgp_private_key
res = r.check(
[
"-----BEGIN PGP PRIVATE KEY BLOCK-----Comment: Alice's OpenPGP Transferable Secret KeyComment: https://www.ietf.org/id/draft-bre-openpgp-samples-01.htmllFgEXEcE6RYJKwYBBAHaRw8BAQdArjWwk3FAqyiFbFBKT4TzXcVBqPTB3gmzlC/Ub7O1u10AAP9XBeW6lzGOLx7zHH9AsUDUTb2pggYGMzd0P3ulJ2AfvQ4RtCZBbGljZSBMb3ZlbGFjZSA8YWxpY2VAb3BlbnBncC5leGFtcGxlPoiQBBMWCAA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEE64W7X6M6deFelE5j8jFVDE9H444FAl2lnzoACgkQ8jFVDE9H447pKwD6A5xwUqIDprBzrHfahrImaYEZzncqb25vkLV2arYfa78A/R3AwtLQvjxwLDuzk4dUtUwvUYibL2sAHwj2kGaHnfICnF0EXEcE6RIKKwYBBAGXVQEFAQEHQEL/BiGtq0k84Km1wqQw2DIikVYrQrMttN8d7BPfnr4iAwEIBwAA/3/xFPG6U17rhTuq+07gmEvaFYKfxRB6sgAYiW6TMTpQEK6IeAQYFggAIBYhBOuFu1+jOnXhXpROY/IxVQxPR+OOBQJcRwTpAhsMAAoJEPIxV</s>
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_unix_timestamp():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" in keys
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_arn3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_arn2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype/resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_arn():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_s3_internal2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/directory/"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_s3_internal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/key"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
|
tests.test_regex_identifier/test_asin
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_asin():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["B07ND5BB8V"])
<2> _assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
<3>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_unix_timestamp():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" in keys
|
tests.test_regex_identifier/test_google_api_key
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_google_api_key():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
<2> _assert_match_first_item("Google API Key", res)
<3>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
_assert_match_first_item(name, res)
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
|
tests.test_regex_identifier/test_google_recaptcha_api_key
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
<2> _assert_match_first_item("Google ReCaptcha API Key", res)
<3>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
_assert_match_first_item(name, res)
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
|
tests.test_regex_identifier/test_google_oauth_token
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_google_oauth_token():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
<2> _assert_match_first_item("Google OAuth Token", res)
<3>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
_assert_match_first_item(name, res)
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
|
tests.test_regex_identifier/test_aws_access_key_id
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_aws_access_key_id():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["AKIA31OMZKYAARWZ3ERH"])
<2> _assert_match_first_item("Amazon Web Services Access Key", res)
<3>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
_assert_match_first_item(name, res)
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
|
tests.test_regex_identifier/test_mailgun_api_key
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_mailgun_api_key():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
<2> _assert_match_first_item("Mailgun API Key", res)
<3>
|
===========unchanged ref 0===========
at: tests.test_regex_identifier
_assert_match_first_item(name, res)
at: tests.test_regex_identifier.test_carte_blanche
res = r.check(["30137891521480"])
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_unix_timestamp():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" in keys
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_arn3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_arn2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype/resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_arn():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_s3_internal2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/directory/"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_s3_internal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["s3://bucket/path/key"])
_assert_match_first_item(
"Amazon Web Services Simple Storage (AWS S3) Internal URL", res
)
|
tests.test_regex_identifier/test_twilio_api_key
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_twilio_api_key():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
<2> _assert_match_first_item("Twilio API Key", res)
<3>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
|
tests.test_regex_identifier/test_twilio_account_sid
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_twilio_account_sid():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
<2> _assert_match_first_item("Twilio Account SID", res)
<3>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
_assert_match_first_item(name, res)
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
|
tests.test_regex_identifier/test_twilio_application_sid
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_twilio_application_sid():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
<2> _assert_match_first_item("Twilio Application SID", res)
<3>
|
===========unchanged ref 0===========
at: tests.test_regex_identifier
_assert_match_first_item(name, res)
at: tests.test_regex_identifier.test_switch_card
res = r.check(["633341812811453789"])
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_unix_timestamp():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" in keys
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_arn3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype:resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_arn2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:partition:service:region:account-id:resourcetype/resource"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
|
tests.test_regex_identifier/test_square_application_secret
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_square_application_secret():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
<2> _assert_match_first_item("Square Application Secret", res)
<3>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
|
tests.test_regex_identifier/test_square_access_token
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_square_access_token():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
<2> _assert_match_first_item("Square Access Token", res)
<3>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
_assert_match_first_item(name, res)
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
- reg = copy.copy(reg) # necessary, when checking phone
- # numbers from file that may contain
- # non-international numbers
+ reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
- if "Phone Number" in reg["Name"]:
- number = re.sub(r"[-() ]", "", matched)
- codes_path = "Data/phone_codes.json"
- codes_fullpath = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), codes_path
+ children = reg.get("Children")
+ if children is not None:
+ processed_match = re.sub(
+ children.get("deletion_pattern", ""), "", matched
)
+ matched_children = []
+ if children["method"] == "hashmap":
+ for length in children["lengths"]:
+ try:
+ matched_children.append(
+ children["Items"][processed_match[:length]]
+ )
+ except KeyError:
+ continue
+ else:
+ for element in children["Items"]:
+ if (
+ children["method"] == "regex"
+ and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ )</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s> and re.search(
+ element, processed_match, re.MULTILINE
+ )
+ ) or (
+ children["method"] == "startswith"
+ and processed_match.startswith(element)
+ ):
+ matched_children.append(children["Items"][element])
- with open(codes_fullpath, "rb") as myfile:
- codes = json.load(myfile)
- locations = []
- for code in codes:
- if number.startswith(code["dial_code"]):
- locations.append(code["name"])
- if len(locations) > 0:
- reg["Description"] = (
- "Location(s)" + ": " + ", ".join(locations)
+ if matched_children:
+ reg["Description"] = children.get("entry", "") + ", ".join(
+ matched_children
)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
|
tests.test_regex_identifier/test_stripe_api_key
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_stripe_api_key():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
<2> _assert_match_first_item("Stripe API Key", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_arn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["arn:aws:s3:::my_corporate_bucket/Development/*"])
_assert_match_first_item("Amazon Resource Name (ARN)", res)
|
tests.test_regex_identifier/test_github_access_token
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_github_access_token():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["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:[email protected]"])
<2> _assert_match_first_item("GitHub Access Token", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_unix_timestamp2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" in keys
assert "Recent Unix Timestamp" not in keys
|
tests.test_regex_identifier/test_slack_token
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_slack_token():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
<2> _assert_match_first_item("Slack Token", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_ssh_ed25519_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0wmN/Cr3JXqmLW7u+g9pTh+wyqDHpSQEIQczXkVx9q r00t@my-random_host"
]
)
_assert_match_first_item("SSH ED25519 Public Key", res)
|
tests.test_regex_identifier/test_pgp_public_key
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_pgp_public_key():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(
<2> [
<3> "-----BEGIN PGP PUBLIC KEY BLOCK-----Comment: Alice's OpenPGP certificateComment: https://www.ietf.org/id/draft-bre-openpgp-samples-01.htmlmDMEXEcE6RYJKwYBBAHaRw8BAQdArjWwk3FAqyiFbFBKT4TzXcVBqPTB3gmzlC/Ub7O1u120JkFsaWNlIExvdmVsYWNlIDxhbGljZUBvcGVucGdwLmV4YW1wbGU+iJAEExYIADgCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQTrhbtfozp14V6UTmPyMVUMT0fjjgUCXaWfOgAKCRDyMVUMT0fjjukrAPoDnHBSogOmsHOsd9qGsiZpgRnOdypvbm+QtXZqth9rvwD9HcDC0tC+PHAsO7OTh1S1TC9RiJsvawAfCPaQZoed8gK4OARcRwTpEgorBgEEAZdVAQUBAQdAQv8GIa2rSTzgqbXCpDDYMiKRVitCsy203x3sE9+eviIDAQgHiHgEGBYIACAWIQTrhbtfozp14V6UTmPyMVUMT0fjjgUCXEcE6QIbDAAKCRDyMVUMT0fjjlnQAQDFHUs6TIcxrNTtEZFjUFm1M0PJ1Dng/cDW4xN80fsn0QEA22Kr7VkCjeAEC08VSTeV+QFsmz55/lntWkwY</s>
|
===========below chunk 0===========
# module: tests.test_regex_identifier
def test_pgp_public_key():
# offset: 1
]
)
_assert_match_first_item("PGP Public Key", res)
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
|
tests.test_regex_identifier/test_pgp_private_key
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_pgp_private_key():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(
<2> [
<3> "-----BEGIN PGP PRIVATE KEY BLOCK-----Comment: Alice's OpenPGP Transferable Secret KeyComment: https://www.ietf.org/id/draft-bre-openpgp-samples-01.htmllFgEXEcE6RYJKwYBBAHaRw8BAQdArjWwk3FAqyiFbFBKT4TzXcVBqPTB3gmzlC/Ub7O1u10AAP9XBeW6lzGOLx7zHH9AsUDUTb2pggYGMzd0P3ulJ2AfvQ4RtCZBbGljZSBMb3ZlbGFjZSA8YWxpY2VAb3BlbnBncC5leGFtcGxlPoiQBBMWCAA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEE64W7X6M6deFelE5j8jFVDE9H444FAl2lnzoACgkQ8jFVDE9H447pKwD6A5xwUqIDprBzrHfahrImaYEZzncqb25vkLV2arYfa78A/R3AwtLQvjxwLDuzk4dUtUwvUYibL2sAHwj2kGaHnfICnF0EXEcE6RIKKwYBBAGXVQEFAQEHQEL/BiGtq0k84Km1wqQw2DIikVYrQrMttN8d7BPfnr4iAwEIBwAA/3/xFPG6U17rhTuq+07gmEvaFYKfxRB6sgAYiW6TMTpQEK6IeAQYFggAIBYhBOuFu1+jOnXhXpROY/IxVQxPR+</s>
|
===========below chunk 0===========
# module: tests.test_regex_identifier
def test_pgp_private_key():
# offset: 1
]
)
_assert_match_first_item("PGP Private Key", res)
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
|
tests.test_regex_identifier/test_discord_token
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_discord_token():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
<2> _assert_match_first_item("Discord Bot Token", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_unix_timestamp3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1234567"]) # 7 numbers
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Timestamp" not in keys
assert "Recent Unix Timestamp" not in keys
|
tests.test_regex_identifier/test_discord_token_2
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_discord_token_2():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["MTE4NDQyNjQ0NTAxMjk5MjAz.DPM2DQ.vLNMR02Qxb9DJFucGZK1UtTs__s"])
<2> _assert_match_first_item("Discord Bot Token", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_discord_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_unix_timestamp4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["1577836800000"]) # 2020-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" in keys
|
tests.test_regex_identifier/test_discord_token_3
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_discord_token_3():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["ODYyOTUyOTE3NTg4NjM5NzY1.YOf1iA.7lARgFXmodxpgmPvOXapaKUga6M"])
<2> _assert_match_first_item("Discord Bot Token", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_discord_token_2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["MTE4NDQyNjQ0NTAxMjk5MjAz.DPM2DQ.vLNMR02Qxb9DJFucGZK1UtTs__s"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_discord_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_unix_timestamp5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["94694400000"]) # 1973-01-01
keys = [m["Regex Pattern"]["Name"] for m in res]
assert "Unix Millisecond Timestamp" in keys
assert "Recent Unix Millisecond Timestamp" not in keys
|
tests.test_regex_identifier/test_placekey
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
<4>:<del> r = regex_identifier.RegexIdentifier()
<8>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_placekey():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["zzw-223@63r-6cs-j5f"])
<2> _assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
<3>
<4> r = regex_identifier.RegexIdentifier()
<5> res = r.check(["226-223@5py-nm7-fs5"])
<6> _assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
<7>
<8> r = regex_identifier.RegexIdentifier()
<9> res = r.check(["22d@627-s8q-xkf"])
<10> _assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
<11>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_discord_token_3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ODYyOTUyOTE3NTg4NjM5NzY1.YOf1iA.7lARgFXmodxpgmPvOXapaKUga6M"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_discord_token_2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["MTE4NDQyNjQ0NTAxMjk5MjAz.DPM2DQ.vLNMR02Qxb9DJFucGZK1UtTs__s"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_discord_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_aws_secret_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["Nw0XP0t2OdyUkaIk3B8TaAa2gEXAMPLEMvD2tW+g"])
assert "Amazon Web Services Secret Access Key" in str(res)
|
tests.test_regex_identifier/test_bcglobal
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_bcglobal():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["6556123456789012"])
<2> _assert_match_first_item("BCGlobal Card Number", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_discord_token_3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ODYyOTUyOTE3NTg4NjM5NzY1.YOf1iA.7lARgFXmodxpgmPvOXapaKUga6M"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_discord_token_2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["MTE4NDQyNjQ0NTAxMjk5MjAz.DPM2DQ.vLNMR02Qxb9DJFucGZK1UtTs__s"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_discord_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_placekey():
- r = regex_identifier.RegexIdentifier()
res = r.check(["zzw-223@63r-6cs-j5f"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["226-223@5py-nm7-fs5"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["22d@627-s8q-xkf"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
|
tests.test_regex_identifier/test_carte_blanche
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_carte_blanche():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["30137891521480"])
<2> _assert_match_first_item("Carte Blanche Card Number", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_bcglobal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6556123456789012"])
_assert_match_first_item("BCGlobal Card Number", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_discord_token_3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ODYyOTUyOTE3NTg4NjM5NzY1.YOf1iA.7lARgFXmodxpgmPvOXapaKUga6M"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_discord_token_2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["MTE4NDQyNjQ0NTAxMjk5MjAz.DPM2DQ.vLNMR02Qxb9DJFucGZK1UtTs__s"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_discord_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_placekey():
- r = regex_identifier.RegexIdentifier()
res = r.check(["zzw-223@63r-6cs-j5f"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["226-223@5py-nm7-fs5"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["22d@627-s8q-xkf"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_google_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AIzaSyD7CQl6fRhagGok6CzFGOOPne2X1u1spoA"])
_assert_match_first_item("Google API Key", res)
|
tests.test_regex_identifier/test_instapayment
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_instapayment():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["6387849878080951"])
<2> _assert_match_first_item("Insta Payment Card Number", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_carte_blanche():
- r = regex_identifier.RegexIdentifier()
res = r.check(["30137891521480"])
_assert_match_first_item("Carte Blanche Card Number", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_bcglobal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6556123456789012"])
_assert_match_first_item("BCGlobal Card Number", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_discord_token_3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ODYyOTUyOTE3NTg4NjM5NzY1.YOf1iA.7lARgFXmodxpgmPvOXapaKUga6M"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_discord_token_2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["MTE4NDQyNjQ0NTAxMjk5MjAz.DPM2DQ.vLNMR02Qxb9DJFucGZK1UtTs__s"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_discord_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_placekey():
- r = regex_identifier.RegexIdentifier()
res = r.check(["zzw-223@63r-6cs-j5f"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["226-223@5py-nm7-fs5"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["22d@627-s8q-xkf"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_aws_sg_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sg-6e616f6d69"])
assert "Amazon Web Services EC2 Security Group identifier" in str(res)
|
tests.test_regex_identifier/test_jcb_card
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
<4>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_jcb_card():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["3537124887293334"])
<2> _assert_match_first_item("JCB Card Number", res)
<3>
<4> r = regex_identifier.RegexIdentifier()
<5> res = r.check(["3543824683332150682"])
<6> _assert_match_first_item("JCB Card Number", res)
<7>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_instapayment():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6387849878080951"])
_assert_match_first_item("Insta Payment Card Number", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_carte_blanche():
- r = regex_identifier.RegexIdentifier()
res = r.check(["30137891521480"])
_assert_match_first_item("Carte Blanche Card Number", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_bcglobal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6556123456789012"])
_assert_match_first_item("BCGlobal Card Number", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_discord_token_3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ODYyOTUyOTE3NTg4NjM5NzY1.YOf1iA.7lARgFXmodxpgmPvOXapaKUga6M"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_discord_token_2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["MTE4NDQyNjQ0NTAxMjk5MjAz.DPM2DQ.vLNMR02Qxb9DJFucGZK1UtTs__s"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_discord_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_placekey():
- r = regex_identifier.RegexIdentifier()
res = r.check(["zzw-223@63r-6cs-j5f"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["226-223@5py-nm7-fs5"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["22d@627-s8q-xkf"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_google_oauth_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ya29.AHES6ZRnn6CfjjaK6GCQ84vikePv_hk4NUAJwzaAXamCL0s"])
_assert_match_first_item("Google OAuth Token", res)
|
tests.test_regex_identifier/test_switch_card
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_switch_card():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["633341812811453789"])
<2> _assert_match_first_item("Switch Card Number", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_instapayment():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6387849878080951"])
_assert_match_first_item("Insta Payment Card Number", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_carte_blanche():
- r = regex_identifier.RegexIdentifier()
res = r.check(["30137891521480"])
_assert_match_first_item("Carte Blanche Card Number", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_bcglobal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6556123456789012"])
_assert_match_first_item("BCGlobal Card Number", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_jcb_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["3537124887293334"])
_assert_match_first_item("JCB Card Number", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["3543824683332150682"])
_assert_match_first_item("JCB Card Number", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_discord_token_3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ODYyOTUyOTE3NTg4NjM5NzY1.YOf1iA.7lARgFXmodxpgmPvOXapaKUga6M"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_discord_token_2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["MTE4NDQyNjQ0NTAxMjk5MjAz.DPM2DQ.vLNMR02Qxb9DJFucGZK1UtTs__s"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_discord_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_placekey():
- r = regex_identifier.RegexIdentifier()
res = r.check(["zzw-223@63r-6cs-j5f"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["226-223@5py-nm7-fs5"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["22d@627-s8q-xkf"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_google_recaptcha_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6Le3W6QUAAAANNT8X_9JwlNnK4kZGLaYTB3KqFLM"])
_assert_match_first_item("Google ReCaptcha API Key", res)
|
tests.test_regex_identifier/test_korean_card
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_korean_card():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["9837282929900015"])
<2> _assert_match_first_item("Korean Local Card Number", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_switch_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["633341812811453789"])
_assert_match_first_item("Switch Card Number", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_instapayment():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6387849878080951"])
_assert_match_first_item("Insta Payment Card Number", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_carte_blanche():
- r = regex_identifier.RegexIdentifier()
res = r.check(["30137891521480"])
_assert_match_first_item("Carte Blanche Card Number", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_bcglobal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6556123456789012"])
_assert_match_first_item("BCGlobal Card Number", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_jcb_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["3537124887293334"])
_assert_match_first_item("JCB Card Number", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["3543824683332150682"])
_assert_match_first_item("JCB Card Number", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_discord_token_3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ODYyOTUyOTE3NTg4NjM5NzY1.YOf1iA.7lARgFXmodxpgmPvOXapaKUga6M"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_discord_token_2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["MTE4NDQyNjQ0NTAxMjk5MjAz.DPM2DQ.vLNMR02Qxb9DJFucGZK1UtTs__s"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_discord_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_placekey():
- r = regex_identifier.RegexIdentifier()
res = r.check(["zzw-223@63r-6cs-j5f"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["226-223@5py-nm7-fs5"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["22d@627-s8q-xkf"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_asin():
- r = regex_identifier.RegexIdentifier()
res = r.check(["B07ND5BB8V"])
_assert_match_first_item("Amazon Standard Identification Number (ASIN)", res)
|
tests.test_regex_identifier/test_laser_card
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_laser_card():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["630495060000000000"])
<2> _assert_match_first_item("Laser Card Number", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_korean_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["9837282929900015"])
_assert_match_first_item("Korean Local Card Number", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_switch_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["633341812811453789"])
_assert_match_first_item("Switch Card Number", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_instapayment():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6387849878080951"])
_assert_match_first_item("Insta Payment Card Number", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_carte_blanche():
- r = regex_identifier.RegexIdentifier()
res = r.check(["30137891521480"])
_assert_match_first_item("Carte Blanche Card Number", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_bcglobal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6556123456789012"])
_assert_match_first_item("BCGlobal Card Number", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_jcb_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["3537124887293334"])
_assert_match_first_item("JCB Card Number", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["3543824683332150682"])
_assert_match_first_item("JCB Card Number", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_discord_token_3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ODYyOTUyOTE3NTg4NjM5NzY1.YOf1iA.7lARgFXmodxpgmPvOXapaKUga6M"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_discord_token_2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["MTE4NDQyNjQ0NTAxMjk5MjAz.DPM2DQ.vLNMR02Qxb9DJFucGZK1UtTs__s"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_discord_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_placekey():
- r = regex_identifier.RegexIdentifier()
res = r.check(["zzw-223@63r-6cs-j5f"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["226-223@5py-nm7-fs5"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["22d@627-s8q-xkf"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
|
tests.test_regex_identifier/test_solo_card
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = regex_identifier.RegexIdentifier()
|
# module: tests.test_regex_identifier
def test_solo_card():
<0> r = regex_identifier.RegexIdentifier()
<1> res = r.check(["6334498823141663"])
<2> _assert_match_first_item("Solo Card Number", res)
<3>
|
===========changed ref 0===========
# module: tests.test_regex_identifier
def test_laser_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["630495060000000000"])
_assert_match_first_item("Laser Card Number", res)
===========changed ref 1===========
# module: tests.test_regex_identifier
def test_korean_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["9837282929900015"])
_assert_match_first_item("Korean Local Card Number", res)
===========changed ref 2===========
# module: tests.test_regex_identifier
def test_switch_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["633341812811453789"])
_assert_match_first_item("Switch Card Number", res)
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_instapayment():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6387849878080951"])
_assert_match_first_item("Insta Payment Card Number", res)
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_carte_blanche():
- r = regex_identifier.RegexIdentifier()
res = r.check(["30137891521480"])
_assert_match_first_item("Carte Blanche Card Number", res)
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_bcglobal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6556123456789012"])
_assert_match_first_item("BCGlobal Card Number", res)
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_jcb_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["3537124887293334"])
_assert_match_first_item("JCB Card Number", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["3543824683332150682"])
_assert_match_first_item("JCB Card Number", res)
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_discord_token_3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["ODYyOTUyOTE3NTg4NjM5NzY1.YOf1iA.7lARgFXmodxpgmPvOXapaKUga6M"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_discord_token_2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["MTE4NDQyNjQ0NTAxMjk5MjAz.DPM2DQ.vLNMR02Qxb9DJFucGZK1UtTs__s"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_discord_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["NzQ4MDk3ODM3OTgzODU4NzIz.X0YeZw.UlcjuCywUAWvPH9s-3cXNBaq3M4"])
_assert_match_first_item("Discord Bot Token", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_slack_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
_assert_match_first_item("Slack Token", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_stripe_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
_assert_match_first_item("Stripe API Key", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_github_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["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:[email protected]"])
_assert_match_first_item("GitHub Access Token", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_twilio_application_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["APfff01abd2b134a2aff3adc243ab211ab"])
_assert_match_first_item("Twilio Application SID", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_twilio_account_sid():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AC10a133ffdfb112abb2d3f42d1d2d3b14"])
_assert_match_first_item("Twilio Account SID", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_square_application_secret():
- r = regex_identifier.RegexIdentifier()
res = r.check(["sq0csp-LBptIQ85io8CvbjVDvmzD1drQbOERgjlhnNrMgscFGk"])
_assert_match_first_item("Square Application Secret", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_twilio_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["SK012dab2d3f4dab1c2f33dffafdf23142"])
_assert_match_first_item("Twilio API Key", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_square_access_token():
- r = regex_identifier.RegexIdentifier()
res = r.check(["EAAAEBQZoq15Ub0PBBr_kw0zK-uIHcBPBZcfjPFT05ODfjng9GqFK9Dbgtj1ILcU"])
_assert_match_first_item("Square Access Token", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_aws_access_key_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_mailgun_api_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["key-1e1631a9414aff7c262721e7b6ff6e43"])
_assert_match_first_item("Mailgun API Key", res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_placekey():
- r = regex_identifier.RegexIdentifier()
res = r.check(["zzw-223@63r-6cs-j5f"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["226-223@5py-nm7-fs5"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
- r = regex_identifier.RegexIdentifier()
res = r.check(["22d@627-s8q-xkf"])
_assert_match_first_item("Placekey Universal Identifier for Physical Place", res)
|
tests.test_filtration/test_distribution
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<1>:<del> regexes = load_regexes()
|
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
<0> dist = Distribution()
<1> regexes = load_regexes()
<2> assert regexes == dist.get_regexes()
<3>
|
===========unchanged ref 0===========
at: _pytest.mark.structures
MARK_GEN = MarkGenerator(_ispytest=True)
at: _pytest.mark.structures.MarkGenerator
skip: _SkipMarkDecorator
skipif: _SkipifMarkDecorator
xfail: _XfailMarkDecorator
parametrize: _ParametrizeMarkDecorator
usefixtures: _UsefixturesMarkDecorator
filterwarnings: _FilterwarningsMarkDecorator
at: pywhat.filter
Distribution(filter: Optional[Filter]=None)
===========changed ref 0===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 1===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 2===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 3===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_discover_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6011000000000004"])
_assert_match_first_item("Discover Card Number", res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_ssn9():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_ssn8():
- r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_ssn7():
- r = regex_identifier.RegexIdentifier()
res = r.check(["666-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_ssn6():
- r = regex_identifier.RegexIdentifier()
res = r.check(["999-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_phone_number():
- r = regex_identifier.RegexIdentifier()
res = r.check(["202-555-0178"])
_assert_match_first_item("Phone Number", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_email2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["[email protected]"])
_assert_match_first_item("Email Address", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_email():
- r = regex_identifier.RegexIdentifier()
res = r.check(["[email protected]"])
_assert_match_first_item("Email Address", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_visa():
- r = regex_identifier.RegexIdentifier()
res = r.check(["4111111111111111"])
_assert_match_first_item("Visa Card Number", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_ssn5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["900-01-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_ssn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["001 01 0001"])
_assert_match_first_item("American Social Security Number", res)
===========changed ref 22===========
# module: tests.test_regex_identifier
def test_american_express():
- r = regex_identifier.RegexIdentifier()
res = r.check(["340000000000009"])
_assert_match_first_item("American Express Card Number", res)
===========changed ref 23===========
# module: tests.test_regex_identifier
def test_ctf_flag():
- r = regex_identifier.RegexIdentifier()
res = r.check(["thm{hello}"])
_assert_match_first_item("TryHackMe Flag Format", res)
===========changed ref 24===========
# module: tests.test_regex_identifier
def test_laser_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["630495060000000000"])
_assert_match_first_item("Laser Card Number", res)
===========changed ref 25===========
# module: tests.test_regex_identifier
def test_bcglobal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6556123456789012"])
_assert_match_first_item("BCGlobal Card Number", res)
===========changed ref 26===========
# module: tests.test_regex_identifier
def test_ssn3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["001.01.0001"])
_assert_match_first_item("American Social Security Number", res)
===========changed ref 27===========
# module: tests.test_regex_identifier
def test_ssn2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["001:01:0001"])
_assert_match_first_item("American Social Security Number", res)
===========changed ref 28===========
# module: tests.test_regex_identifier
def test_ssn():
- r = regex_identifier.RegexIdentifier()
res = r.check(["001-01-0001"])
_assert_match_first_item("American Social Security Number", res)
===========changed ref 29===========
# module: tests.test_regex_identifier
def test_ctf_flag_uppercase():
- r = regex_identifier.RegexIdentifier()
res = r.check(["FLAG{hello}"])
_assert_match_first_item("Capture The Flag (CTF) Flag", res)
|
tests.test_filtration/test_distribution2
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<7>:<del> regexes = load_regexes()
|
# module: tests.test_filtration
def test_distribution2():
<0> filter = {
<1> "MinRarity": 0.3,
<2> "MaxRarity": 0.8,
<3> "Tags": ["Networking"],
<4> "ExcludeTags": ["Identifiers"],
<5> }
<6> dist = Distribution(filter)
<7> regexes = load_regexes()
<8> for regex in regexes:
<9> if (
<10> 0.3 <= regex["Rarity"] <= 0.8
<11> and "Networking" in regex["Tags"]
<12> and "Identifiers" not in regex["Tags"]
<13> ):
<14> assert regex in dist.get_regexes()
<15>
|
===========unchanged ref 0===========
at: pywhat.filter
Distribution(filter: Optional[Filter]=None)
at: pywhat.filter.Distribution
get_regexes()
at: tests.test_filtration
regexes = load_regexes()
===========changed ref 0===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 1===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 2===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 3===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 4===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_discover_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6011000000000004"])
_assert_match_first_item("Discover Card Number", res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_ssn9():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_ssn8():
- r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_ssn7():
- r = regex_identifier.RegexIdentifier()
res = r.check(["666-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_ssn6():
- r = regex_identifier.RegexIdentifier()
res = r.check(["999-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_phone_number():
- r = regex_identifier.RegexIdentifier()
res = r.check(["202-555-0178"])
_assert_match_first_item("Phone Number", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_email2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["[email protected]"])
_assert_match_first_item("Email Address", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_email():
- r = regex_identifier.RegexIdentifier()
res = r.check(["[email protected]"])
_assert_match_first_item("Email Address", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_visa():
- r = regex_identifier.RegexIdentifier()
res = r.check(["4111111111111111"])
_assert_match_first_item("Visa Card Number", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_ssn5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["900-01-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 22===========
# module: tests.test_regex_identifier
def test_ssn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["001 01 0001"])
_assert_match_first_item("American Social Security Number", res)
===========changed ref 23===========
# module: tests.test_regex_identifier
def test_american_express():
- r = regex_identifier.RegexIdentifier()
res = r.check(["340000000000009"])
_assert_match_first_item("American Express Card Number", res)
===========changed ref 24===========
# module: tests.test_regex_identifier
def test_ctf_flag():
- r = regex_identifier.RegexIdentifier()
res = r.check(["thm{hello}"])
_assert_match_first_item("TryHackMe Flag Format", res)
===========changed ref 25===========
# module: tests.test_regex_identifier
def test_laser_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["630495060000000000"])
_assert_match_first_item("Laser Card Number", res)
===========changed ref 26===========
# module: tests.test_regex_identifier
def test_bcglobal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6556123456789012"])
_assert_match_first_item("BCGlobal Card Number", res)
===========changed ref 27===========
# module: tests.test_regex_identifier
def test_ssn3():
- r = regex_identifier.RegexIdentifier()
res = r.check(["001.01.0001"])
_assert_match_first_item("American Social Security Number", res)
===========changed ref 28===========
# module: tests.test_regex_identifier
def test_ssn2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["001:01:0001"])
_assert_match_first_item("American Social Security Number", res)
===========changed ref 29===========
# module: tests.test_regex_identifier
def test_ssn():
- r = regex_identifier.RegexIdentifier()
res = r.check(["001-01-0001"])
_assert_match_first_item("American Social Security Number", res)
|
tests.test_filtration/test_distribution3
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<3>:<del> regexes = load_regexes()
|
# module: tests.test_filtration
def test_distribution3():
<0> filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
<1> filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
<2> dist = Distribution(filter1) & Distribution(filter2)
<3> regexes = load_regexes()
<4> assert dist._dict["MinRarity"] == 0.4
<5> assert dist._dict["MaxRarity"] == 0.8
<6> assert dist._dict["Tags"] == CaseInsensitiveSet(["Networking"])
<7> assert dist._dict["ExcludeTags"] == CaseInsensitiveSet()
<8>
<9> for regex in regexes:
<10> if 0.4 <= regex["Rarity"] <= 0.8 and "Networking" in regex["Tags"]:
<11> assert regex in dist.get_regexes()
<12>
|
===========unchanged ref 0===========
at: pywhat.filter
Distribution(filter: Optional[Filter]=None)
at: pywhat.filter.Distribution
get_regexes()
at: pywhat.filter.Filter.__init__
self._dict = dict()
at: pywhat.helper
CaseInsensitiveSet(iterable=None)
at: tests.test_filtration
regexes = load_regexes()
===========changed ref 0===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 1===========
# module: tests.test_filtration
def test_distribution2():
filter = {
"MinRarity": 0.3,
"MaxRarity": 0.8,
"Tags": ["Networking"],
"ExcludeTags": ["Identifiers"],
}
dist = Distribution(filter)
- regexes = load_regexes()
for regex in regexes:
if (
0.3 <= regex["Rarity"] <= 0.8
and "Networking" in regex["Tags"]
and "Identifiers" not in regex["Tags"]
):
assert regex in dist.get_regexes()
===========changed ref 2===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 3===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 4===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 5===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_discover_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6011000000000004"])
_assert_match_first_item("Discover Card Number", res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_ssn9():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_ssn8():
- r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_ssn7():
- r = regex_identifier.RegexIdentifier()
res = r.check(["666-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_ssn6():
- r = regex_identifier.RegexIdentifier()
res = r.check(["999-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_phone_number():
- r = regex_identifier.RegexIdentifier()
res = r.check(["202-555-0178"])
_assert_match_first_item("Phone Number", res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_email2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["[email protected]"])
_assert_match_first_item("Email Address", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_email():
- r = regex_identifier.RegexIdentifier()
res = r.check(["[email protected]"])
_assert_match_first_item("Email Address", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_visa():
- r = regex_identifier.RegexIdentifier()
res = r.check(["4111111111111111"])
_assert_match_first_item("Visa Card Number", res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 22===========
# module: tests.test_regex_identifier
def test_ssn5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["900-01-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 23===========
# module: tests.test_regex_identifier
def test_ssn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["001 01 0001"])
_assert_match_first_item("American Social Security Number", res)
===========changed ref 24===========
# module: tests.test_regex_identifier
def test_american_express():
- r = regex_identifier.RegexIdentifier()
res = r.check(["340000000000009"])
_assert_match_first_item("American Express Card Number", res)
===========changed ref 25===========
# module: tests.test_regex_identifier
def test_ctf_flag():
- r = regex_identifier.RegexIdentifier()
res = r.check(["thm{hello}"])
_assert_match_first_item("TryHackMe Flag Format", res)
===========changed ref 26===========
# module: tests.test_regex_identifier
def test_laser_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["630495060000000000"])
_assert_match_first_item("Laser Card Number", res)
===========changed ref 27===========
# module: tests.test_regex_identifier
def test_bcglobal():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6556123456789012"])
_assert_match_first_item("BCGlobal Card Number", res)
|
tests.test_filtration/test_distribution4
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<4>:<del> regexes = load_regexes()
|
# module: tests.test_filtration
def test_distribution4():
<0> filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
<1> filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
<2> dist = Distribution(filter2)
<3> dist &= Distribution(filter1)
<4> regexes = load_regexes()
<5> assert dist._dict["MinRarity"] == 0.4
<6> assert dist._dict["MaxRarity"] == 0.8
<7> assert dist._dict["Tags"] == CaseInsensitiveSet(["Networking"])
<8> assert dist._dict["ExcludeTags"] == CaseInsensitiveSet()
<9>
<10> for regex in regexes:
<11> if 0.4 <= regex["Rarity"] <= 0.8 and "Networking" in regex["Tags"]:
<12> assert regex in dist.get_regexes()
<13>
|
===========unchanged ref 0===========
at: pywhat.filter
Distribution(filter: Optional[Filter]=None)
at: pywhat.filter.Distribution
get_regexes()
at: pywhat.filter.Filter.__init__
self._dict = dict()
at: pywhat.helper
CaseInsensitiveSet(iterable=None)
at: tests.test_filtration
regexes = load_regexes()
===========changed ref 0===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 1===========
# module: tests.test_filtration
def test_distribution2():
filter = {
"MinRarity": 0.3,
"MaxRarity": 0.8,
"Tags": ["Networking"],
"ExcludeTags": ["Identifiers"],
}
dist = Distribution(filter)
- regexes = load_regexes()
for regex in regexes:
if (
0.3 <= regex["Rarity"] <= 0.8
and "Networking" in regex["Tags"]
and "Identifiers" not in regex["Tags"]
):
assert regex in dist.get_regexes()
===========changed ref 2===========
# module: tests.test_filtration
def test_distribution3():
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
dist = Distribution(filter1) & Distribution(filter2)
- regexes = load_regexes()
assert dist._dict["MinRarity"] == 0.4
assert dist._dict["MaxRarity"] == 0.8
assert dist._dict["Tags"] == CaseInsensitiveSet(["Networking"])
assert dist._dict["ExcludeTags"] == CaseInsensitiveSet()
for regex in regexes:
if 0.4 <= regex["Rarity"] <= 0.8 and "Networking" in regex["Tags"]:
assert regex in dist.get_regexes()
===========changed ref 3===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 4===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 5===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 6===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_discover_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6011000000000004"])
_assert_match_first_item("Discover Card Number", res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_ssn9():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_ssn8():
- r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_ssn7():
- r = regex_identifier.RegexIdentifier()
res = r.check(["666-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_ssn6():
- r = regex_identifier.RegexIdentifier()
res = r.check(["999-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_phone_number():
- r = regex_identifier.RegexIdentifier()
res = r.check(["202-555-0178"])
_assert_match_first_item("Phone Number", res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_email2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["[email protected]"])
_assert_match_first_item("Email Address", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_email():
- r = regex_identifier.RegexIdentifier()
res = r.check(["[email protected]"])
_assert_match_first_item("Email Address", res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_visa():
- r = regex_identifier.RegexIdentifier()
res = r.check(["4111111111111111"])
_assert_match_first_item("Visa Card Number", res)
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
===========changed ref 22===========
# module: tests.test_regex_identifier
def test_aws_access_key():
- r = regex_identifier.RegexIdentifier()
res = r.check(["AKIAIOSFODNN7EXAMPLE"])
assert "Amazon Web Services Access Key" in str(res)
===========changed ref 23===========
# module: tests.test_regex_identifier
def test_ssn5():
- r = regex_identifier.RegexIdentifier()
res = r.check(["900-01-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 24===========
# module: tests.test_regex_identifier
def test_ssn4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["001 01 0001"])
_assert_match_first_item("American Social Security Number", res)
===========changed ref 25===========
# module: tests.test_regex_identifier
def test_american_express():
- r = regex_identifier.RegexIdentifier()
res = r.check(["340000000000009"])
_assert_match_first_item("American Express Card Number", res)
|
tests.test_filtration/test_distribution5
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<3>:<del> regexes = load_regexes()
|
# module: tests.test_filtration
def test_distribution5():
<0> filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
<1> filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
<2> dist = Distribution(filter1) | Distribution(filter2)
<3> regexes = load_regexes()
<4> assert dist._dict["MinRarity"] == 0.3
<5> assert dist._dict["MaxRarity"] == 1
<6> assert dist._dict["Tags"] == CaseInsensitiveSet(pywhat_tags)
<7> assert dist._dict["ExcludeTags"] == CaseInsensitiveSet(["Identifiers", "Media"])
<8>
<9> for regex in regexes:
<10> if (
<11> 0.3 <= regex["Rarity"] <= 1
<12> and "Identifiers" not in regex["Tags"]
<13> and "Media" not in regex["Tags"]
<14> ):
<15> assert regex in dist.get_regexes()
<16>
|
===========unchanged ref 0===========
at: pywhat
pywhat_tags = AvailableTags().get_tags()
at: pywhat.filter
Distribution(filter: Optional[Filter]=None)
at: pywhat.filter.Distribution
get_regexes()
at: pywhat.filter.Filter.__init__
self._dict = dict()
at: pywhat.helper
CaseInsensitiveSet(iterable=None)
at: tests.test_filtration
regexes = load_regexes()
at: tests.test_filtration.test_distribution5
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
===========changed ref 0===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 1===========
# module: tests.test_filtration
def test_distribution2():
filter = {
"MinRarity": 0.3,
"MaxRarity": 0.8,
"Tags": ["Networking"],
"ExcludeTags": ["Identifiers"],
}
dist = Distribution(filter)
- regexes = load_regexes()
for regex in regexes:
if (
0.3 <= regex["Rarity"] <= 0.8
and "Networking" in regex["Tags"]
and "Identifiers" not in regex["Tags"]
):
assert regex in dist.get_regexes()
===========changed ref 2===========
# module: tests.test_filtration
def test_distribution4():
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
dist = Distribution(filter2)
dist &= Distribution(filter1)
- regexes = load_regexes()
assert dist._dict["MinRarity"] == 0.4
assert dist._dict["MaxRarity"] == 0.8
assert dist._dict["Tags"] == CaseInsensitiveSet(["Networking"])
assert dist._dict["ExcludeTags"] == CaseInsensitiveSet()
for regex in regexes:
if 0.4 <= regex["Rarity"] <= 0.8 and "Networking" in regex["Tags"]:
assert regex in dist.get_regexes()
===========changed ref 3===========
# module: tests.test_filtration
def test_distribution3():
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
dist = Distribution(filter1) & Distribution(filter2)
- regexes = load_regexes()
assert dist._dict["MinRarity"] == 0.4
assert dist._dict["MaxRarity"] == 0.8
assert dist._dict["Tags"] == CaseInsensitiveSet(["Networking"])
assert dist._dict["ExcludeTags"] == CaseInsensitiveSet()
for regex in regexes:
if 0.4 <= regex["Rarity"] <= 0.8 and "Networking" in regex["Tags"]:
assert regex in dist.get_regexes()
===========changed ref 4===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 5===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 6===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_discover_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6011000000000004"])
_assert_match_first_item("Discover Card Number", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_ssn9():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_ssn8():
- r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_ssn7():
- r = regex_identifier.RegexIdentifier()
res = r.check(["666-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_ssn6():
- r = regex_identifier.RegexIdentifier()
res = r.check(["999-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 18===========
# module: tests.test_regex_identifier
def test_phone_number():
- r = regex_identifier.RegexIdentifier()
res = r.check(["202-555-0178"])
_assert_match_first_item("Phone Number", res)
===========changed ref 19===========
# module: tests.test_regex_identifier
def test_email2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["[email protected]"])
_assert_match_first_item("Email Address", res)
===========changed ref 20===========
# module: tests.test_regex_identifier
def test_email():
- r = regex_identifier.RegexIdentifier()
res = r.check(["[email protected]"])
_assert_match_first_item("Email Address", res)
===========changed ref 21===========
# module: tests.test_regex_identifier
def test_visa():
- r = regex_identifier.RegexIdentifier()
res = r.check(["4111111111111111"])
_assert_match_first_item("Visa Card Number", res)
===========changed ref 22===========
# module: tests.test_regex_identifier
def test_aws_ec2_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["i-1234567890abcdef0"])
assert "Amazon Web Services EC2 Instance identifier" in str(res)
|
tests.test_filtration/test_distribution6
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<4>:<del> regexes = load_regexes()
|
# module: tests.test_filtration
def test_distribution6():
<0> filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
<1> filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
<2> dist = Distribution(filter2)
<3> dist |= Distribution(filter1)
<4> regexes = load_regexes()
<5> assert dist._dict["MinRarity"] == 0.3
<6> assert dist._dict["MaxRarity"] == 1
<7> assert dist._dict["Tags"] == CaseInsensitiveSet(pywhat_tags)
<8> assert dist._dict["ExcludeTags"] == CaseInsensitiveSet(["Identifiers", "Media"])
<9>
<10> for regex in regexes:
<11> if (
<12> 0.3 <= regex["Rarity"] <= 1
<13> and "Identifiers" not in regex["Tags"]
<14> and "Media" not in regex["Tags"]
<15> ):
<16> assert regex in dist.get_regexes()
<17>
|
===========unchanged ref 0===========
at: _pytest.python_api
raises(expected_exception: Union[Type[E], Tuple[Type[E], ...]], func: Callable[..., Any], *args: Any, **kwargs: Any) -> _pytest._code.ExceptionInfo[E]
raises(expected_exception: Union[Type[E], Tuple[Type[E], ...]], *, match: Optional[Union[str, Pattern[str]]]=...) -> "RaisesContext[E]"
at: pywhat
pywhat_tags = AvailableTags().get_tags()
at: pywhat.filter
Distribution(filter: Optional[Filter]=None)
at: pywhat.filter.Distribution
get_regexes()
at: pywhat.filter.Filter.__init__
self._dict = dict()
at: pywhat.helper
InvalidTag(*args: object)
CaseInsensitiveSet(iterable=None)
at: tests.test_filtration
regexes = load_regexes()
at: tests.test_filtration.test_distribution6
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
===========changed ref 0===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 1===========
# module: tests.test_filtration
def test_distribution2():
filter = {
"MinRarity": 0.3,
"MaxRarity": 0.8,
"Tags": ["Networking"],
"ExcludeTags": ["Identifiers"],
}
dist = Distribution(filter)
- regexes = load_regexes()
for regex in regexes:
if (
0.3 <= regex["Rarity"] <= 0.8
and "Networking" in regex["Tags"]
and "Identifiers" not in regex["Tags"]
):
assert regex in dist.get_regexes()
===========changed ref 2===========
# module: tests.test_filtration
def test_distribution4():
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
dist = Distribution(filter2)
dist &= Distribution(filter1)
- regexes = load_regexes()
assert dist._dict["MinRarity"] == 0.4
assert dist._dict["MaxRarity"] == 0.8
assert dist._dict["Tags"] == CaseInsensitiveSet(["Networking"])
assert dist._dict["ExcludeTags"] == CaseInsensitiveSet()
for regex in regexes:
if 0.4 <= regex["Rarity"] <= 0.8 and "Networking" in regex["Tags"]:
assert regex in dist.get_regexes()
===========changed ref 3===========
# module: tests.test_filtration
def test_distribution5():
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
dist = Distribution(filter1) | Distribution(filter2)
- regexes = load_regexes()
assert dist._dict["MinRarity"] == 0.3
assert dist._dict["MaxRarity"] == 1
assert dist._dict["Tags"] == CaseInsensitiveSet(pywhat_tags)
assert dist._dict["ExcludeTags"] == CaseInsensitiveSet(["Identifiers", "Media"])
for regex in regexes:
if (
0.3 <= regex["Rarity"] <= 1
and "Identifiers" not in regex["Tags"]
and "Media" not in regex["Tags"]
):
assert regex in dist.get_regexes()
===========changed ref 4===========
# module: tests.test_filtration
def test_distribution3():
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
dist = Distribution(filter1) & Distribution(filter2)
- regexes = load_regexes()
assert dist._dict["MinRarity"] == 0.4
assert dist._dict["MaxRarity"] == 0.8
assert dist._dict["Tags"] == CaseInsensitiveSet(["Networking"])
assert dist._dict["ExcludeTags"] == CaseInsensitiveSet()
for regex in regexes:
if 0.4 <= regex["Rarity"] <= 0.8 and "Networking" in regex["Tags"]:
assert regex in dist.get_regexes()
===========changed ref 5===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 6===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 7===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_discover_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6011000000000004"])
_assert_match_first_item("Discover Card Number", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_ssn9():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_ssn8():
- r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_ssn7():
- r = regex_identifier.RegexIdentifier()
res = r.check(["666-21-2222"])
assert "American Social Security Number" not in str(res)
|
tests.test_filtration/test_filter3
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<8>:<del> regexes = load_regexes()
|
# module: tests.test_filtration
def test_filter3():
<0> filter = {
<1> "MinRarity": 0.3,
<2> "MaxRarity": 0.8,
<3> "Tags": ["Networking"],
<4> "ExcludeTags": ["Identifiers"],
<5> }
<6> filt = Filter(filter)
<7> dist = Distribution(filt)
<8> regexes = load_regexes()
<9> for regex in regexes:
<10> if (
<11> 0.3 <= regex["Rarity"] <= 0.8
<12> and "Networking" in regex["Tags"]
<13> and "Identifiers" not in regex["Tags"]
<14> ):
<15> assert regex in dist.get_regexes()
<16>
|
===========unchanged ref 0===========
at: pywhat.filter
Filter(filters_dict: Optional[Mapping]=None)
Distribution(filter: Optional[Filter]=None)
at: pywhat.filter.Distribution
get_regexes()
at: tests.test_filtration
regexes = load_regexes()
at: tests.test_filtration.test_filter3
filter = {
"MinRarity": 0.3,
"MaxRarity": 0.8,
"Tags": ["Networking"],
"ExcludeTags": ["Identifiers"],
}
===========changed ref 0===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 1===========
# module: tests.test_filtration
def test_distribution2():
filter = {
"MinRarity": 0.3,
"MaxRarity": 0.8,
"Tags": ["Networking"],
"ExcludeTags": ["Identifiers"],
}
dist = Distribution(filter)
- regexes = load_regexes()
for regex in regexes:
if (
0.3 <= regex["Rarity"] <= 0.8
and "Networking" in regex["Tags"]
and "Identifiers" not in regex["Tags"]
):
assert regex in dist.get_regexes()
===========changed ref 2===========
# module: tests.test_filtration
def test_distribution6():
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
dist = Distribution(filter2)
dist |= Distribution(filter1)
- regexes = load_regexes()
assert dist._dict["MinRarity"] == 0.3
assert dist._dict["MaxRarity"] == 1
assert dist._dict["Tags"] == CaseInsensitiveSet(pywhat_tags)
assert dist._dict["ExcludeTags"] == CaseInsensitiveSet(["Identifiers", "Media"])
for regex in regexes:
if (
0.3 <= regex["Rarity"] <= 1
and "Identifiers" not in regex["Tags"]
and "Media" not in regex["Tags"]
):
assert regex in dist.get_regexes()
===========changed ref 3===========
# module: tests.test_filtration
def test_distribution4():
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
dist = Distribution(filter2)
dist &= Distribution(filter1)
- regexes = load_regexes()
assert dist._dict["MinRarity"] == 0.4
assert dist._dict["MaxRarity"] == 0.8
assert dist._dict["Tags"] == CaseInsensitiveSet(["Networking"])
assert dist._dict["ExcludeTags"] == CaseInsensitiveSet()
for regex in regexes:
if 0.4 <= regex["Rarity"] <= 0.8 and "Networking" in regex["Tags"]:
assert regex in dist.get_regexes()
===========changed ref 4===========
# module: tests.test_filtration
def test_distribution5():
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
dist = Distribution(filter1) | Distribution(filter2)
- regexes = load_regexes()
assert dist._dict["MinRarity"] == 0.3
assert dist._dict["MaxRarity"] == 1
assert dist._dict["Tags"] == CaseInsensitiveSet(pywhat_tags)
assert dist._dict["ExcludeTags"] == CaseInsensitiveSet(["Identifiers", "Media"])
for regex in regexes:
if (
0.3 <= regex["Rarity"] <= 1
and "Identifiers" not in regex["Tags"]
and "Media" not in regex["Tags"]
):
assert regex in dist.get_regexes()
===========changed ref 5===========
# module: tests.test_filtration
def test_distribution3():
filter1 = {"MinRarity": 0.3, "Tags": ["Networking"], "ExcludeTags": ["Identifiers"]}
filter2 = {"MinRarity": 0.4, "MaxRarity": 0.8, "ExcludeTags": ["Media"]}
dist = Distribution(filter1) & Distribution(filter2)
- regexes = load_regexes()
assert dist._dict["MinRarity"] == 0.4
assert dist._dict["MaxRarity"] == 0.8
assert dist._dict["Tags"] == CaseInsensitiveSet(["Networking"])
assert dist._dict["ExcludeTags"] == CaseInsensitiveSet()
for regex in regexes:
if 0.4 <= regex["Rarity"] <= 0.8 and "Networking" in regex["Tags"]:
assert regex in dist.get_regexes()
===========changed ref 6===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 7===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 8===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_discover_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6011000000000004"])
_assert_match_first_item("Discover Card Number", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_ssn9():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_ssn8():
- r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "American Social Security Number" not in str(res)
|
tests.test_identifier/test_identifier_works
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = identifier.Identifier()
|
# module: tests.test_identifier
def test_identifier_works():
<0> r = identifier.Identifier()
<1> out = r.identify("DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o")
<2> assert (
<3> "Dogecoin (DOGE) Wallet Address"
<4> in out["Regexes"]["text"][0]["Regex Pattern"]["Name"]
<5> )
<6>
|
===========unchanged ref 0===========
at: pywhat.identifier
Identifier(*, dist: Optional[Distribution]=None, key: Callable=Keys.NONE, reverse=False, boundaryless: Optional[Filter]=None)
at: pywhat.identifier.Identifier
identify(text: str, *, only_text=True, dist: Distribution=None, key: Optional[Callable]=None, reverse: Optional[bool]=None, boundaryless: Optional[Filter]=None, include_filenames=False) -> dict
===========changed ref 0===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
+
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
regex = self._regex_id.check(contents, dist)
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)</s>
===========changed ref 1===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s>
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=key, reverse=reverse
)
return identify_obj
===========changed ref 2===========
# module: tests.test_filtration
+ regexes = load_regexes()
===========changed ref 3===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 4===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 5===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 6===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 7===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_discover_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6011000000000004"])
_assert_match_first_item("Discover Card Number", res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_ssn9():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_ssn8():
- r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_ssn7():
- r = regex_identifier.RegexIdentifier()
res = r.check(["666-21-2222"])
assert "American Social Security Number" not in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_ssn6():
- r = regex_identifier.RegexIdentifier()
res = r.check(["999-21-2222"])
assert "American Social Security Number" not in str(res)
|
tests.test_identifier/test_identifier_works2
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = identifier.Identifier()
|
# module: tests.test_identifier
def test_identifier_works2():
<0> r = identifier.Identifier()
<1> out = r.identify("fixtures/file", only_text=False)
<2> assert "Ethereum (ETH) Wallet Address" in str(out)
<3>
|
===========unchanged ref 0===========
at: pywhat.identifier
Identifier(*, dist: Optional[Distribution]=None, key: Callable=Keys.NONE, reverse=False, boundaryless: Optional[Filter]=None)
at: pywhat.identifier.Identifier
identify(text: str, *, only_text=True, dist: Distribution=None, key: Optional[Callable]=None, reverse: Optional[bool]=None, boundaryless: Optional[Filter]=None, include_filenames=False) -> dict
===========changed ref 0===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
+
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
regex = self._regex_id.check(contents, dist)
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)</s>
===========changed ref 1===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s>
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=key, reverse=reverse
)
return identify_obj
===========changed ref 2===========
# module: tests.test_identifier
def test_identifier_works():
- r = identifier.Identifier()
out = r.identify("DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o")
assert (
"Dogecoin (DOGE) Wallet Address"
in out["Regexes"]["text"][0]["Regex Pattern"]["Name"]
)
===========changed ref 3===========
# module: tests.test_filtration
+ regexes = load_regexes()
===========changed ref 4===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 5===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 6===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 7===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 8===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_discover_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6011000000000004"])
_assert_match_first_item("Discover Card Number", res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_ssn9():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_ssn8():
- r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_ssn7():
- r = regex_identifier.RegexIdentifier()
res = r.check(["666-21-2222"])
assert "American Social Security Number" not in str(res)
|
tests.test_identifier/test_identifier_works3
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = identifier.Identifier()
|
# module: tests.test_identifier
def test_identifier_works3():
<0> r = identifier.Identifier()
<1> out = r.identify("fixtures/file", only_text=False)
<2> assert "Dogecoin (DOGE) Wallet Address" in str(out)
<3>
|
===========unchanged ref 0===========
at: pywhat.identifier
Identifier(*, dist: Optional[Distribution]=None, key: Callable=Keys.NONE, reverse=False, boundaryless: Optional[Filter]=None)
at: pywhat.identifier.Identifier
identify(text: str, *, only_text=True, dist: Distribution=None, key: Optional[Callable]=None, reverse: Optional[bool]=None, boundaryless: Optional[Filter]=None, include_filenames=False) -> dict
===========changed ref 0===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
+
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
regex = self._regex_id.check(contents, dist)
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)</s>
===========changed ref 1===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s>
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=key, reverse=reverse
)
return identify_obj
===========changed ref 2===========
# module: tests.test_identifier
def test_identifier_works2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Ethereum (ETH) Wallet Address" in str(out)
===========changed ref 3===========
# module: tests.test_identifier
def test_identifier_works():
- r = identifier.Identifier()
out = r.identify("DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o")
assert (
"Dogecoin (DOGE) Wallet Address"
in out["Regexes"]["text"][0]["Regex Pattern"]["Name"]
)
===========changed ref 4===========
# module: tests.test_filtration
+ regexes = load_regexes()
===========changed ref 5===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 6===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 7===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 8===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 9===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_discover_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6011000000000004"])
_assert_match_first_item("Discover Card Number", res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_ssn9():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-00-5544"])
assert "American Social Security Number" not in str(res)
===========changed ref 17===========
# module: tests.test_regex_identifier
def test_ssn8():
- r = regex_identifier.RegexIdentifier()
res = r.check(["000-21-5544"])
assert "American Social Security Number" not in str(res)
|
tests.test_identifier/test_identifier_sorting2
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = identifier.Identifier()
|
# module: tests.test_identifier
def test_identifier_sorting2():
<0> r = identifier.Identifier()
<1> out = r.identify("fixtures/file", only_text=False, key=Keys.RARITY, reverse=True)
<2> prev = None
<3> for match in out["Regexes"]["file"]:
<4> if prev is not None:
<5> assert prev >= match["Regex Pattern"]["Rarity"]
<6> prev = match["Regex Pattern"]["Rarity"]
<7>
|
===========unchanged ref 0===========
at: pywhat.helper
Keys()
at: pywhat.identifier
Identifier(*, dist: Optional[Distribution]=None, key: Callable=Keys.NONE, reverse=False, boundaryless: Optional[Filter]=None)
at: pywhat.identifier.Identifier
identify(text: str, *, only_text=True, dist: Distribution=None, key: Optional[Callable]=None, reverse: Optional[bool]=None, boundaryless: Optional[Filter]=None, include_filenames=False) -> dict
===========changed ref 0===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
+
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
regex = self._regex_id.check(contents, dist)
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)</s>
===========changed ref 1===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s>
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=key, reverse=reverse
)
return identify_obj
===========changed ref 2===========
# module: tests.test_identifier
def test_identifier_works3():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Dogecoin (DOGE) Wallet Address" in str(out)
===========changed ref 3===========
# module: tests.test_identifier
def test_identifier_works2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Ethereum (ETH) Wallet Address" in str(out)
===========changed ref 4===========
# module: tests.test_identifier
def test_identifier_works():
- r = identifier.Identifier()
out = r.identify("DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o")
assert (
"Dogecoin (DOGE) Wallet Address"
in out["Regexes"]["text"][0]["Regex Pattern"]["Name"]
)
===========changed ref 5===========
# module: tests.test_filtration
+ regexes = load_regexes()
===========changed ref 6===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 7===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 8===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 9===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 10===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_ssn10():
- r = regex_identifier.RegexIdentifier()
res = r.check(["122-32-0000"])
assert "American Social Security Number" not in str(res)
===========changed ref 16===========
# module: tests.test_regex_identifier
def test_discover_card():
- r = regex_identifier.RegexIdentifier()
res = r.check(["6011000000000004"])
_assert_match_first_item("Discover Card Number", res)
|
tests.test_identifier/test_identifier_sorting3
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = identifier.Identifier()
|
# module: tests.test_identifier
def test_identifier_sorting3():
<0> r = identifier.Identifier()
<1> out = r.identify("fixtures/file", only_text=False, key=Keys.NAME)
<2> prev = None
<3> for match in out["Regexes"]["file"]:
<4> if prev is not None:
<5> assert prev <= match["Regex Pattern"]["Name"]
<6> prev = match["Regex Pattern"]["Name"]
<7>
|
===========unchanged ref 0===========
at: pywhat.helper
Keys()
at: pywhat.identifier
Identifier(*, dist: Optional[Distribution]=None, key: Callable=Keys.NONE, reverse=False, boundaryless: Optional[Filter]=None)
at: pywhat.identifier.Identifier
identify(text: str, *, only_text=True, dist: Distribution=None, key: Optional[Callable]=None, reverse: Optional[bool]=None, boundaryless: Optional[Filter]=None, include_filenames=False) -> dict
===========changed ref 0===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
+
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
regex = self._regex_id.check(contents, dist)
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)</s>
===========changed ref 1===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s>
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=key, reverse=reverse
)
return identify_obj
===========changed ref 2===========
# module: tests.test_identifier
def test_identifier_works3():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Dogecoin (DOGE) Wallet Address" in str(out)
===========changed ref 3===========
# module: tests.test_identifier
def test_identifier_works2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Ethereum (ETH) Wallet Address" in str(out)
===========changed ref 4===========
# module: tests.test_identifier
def test_identifier_sorting2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.RARITY, reverse=True)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev >= match["Regex Pattern"]["Rarity"]
prev = match["Regex Pattern"]["Rarity"]
===========changed ref 5===========
# module: tests.test_identifier
def test_identifier_works():
- r = identifier.Identifier()
out = r.identify("DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o")
assert (
"Dogecoin (DOGE) Wallet Address"
in out["Regexes"]["text"][0]["Regex Pattern"]["Name"]
)
===========changed ref 6===========
# module: tests.test_filtration
+ regexes = load_regexes()
===========changed ref 7===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 8===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 9===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 10===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 11===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_aws_org_id():
- r = regex_identifier.RegexIdentifier()
res = r.check(["o-aa111bb222"])
assert "Amazon Web Services Organization identifier" in str(res)
|
tests.test_identifier/test_identifier_sorting5
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = identifier.Identifier()
|
# module: tests.test_identifier
def test_identifier_sorting5():
<0> r = identifier.Identifier()
<1> out = r.identify("fixtures/file", only_text=False, key=Keys.MATCHED)
<2> prev = None
<3> for match in out["Regexes"]["file"]:
<4> if prev is not None:
<5> assert prev <= match["Matched"]
<6> prev = match["Matched"]
<7>
|
===========unchanged ref 0===========
at: pywhat.helper
Keys()
at: pywhat.identifier
Identifier(*, dist: Optional[Distribution]=None, key: Callable=Keys.NONE, reverse=False, boundaryless: Optional[Filter]=None)
at: pywhat.identifier.Identifier
identify(text: str, *, only_text=True, dist: Distribution=None, key: Optional[Callable]=None, reverse: Optional[bool]=None, boundaryless: Optional[Filter]=None, include_filenames=False) -> dict
===========changed ref 0===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
+
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
regex = self._regex_id.check(contents, dist)
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)</s>
===========changed ref 1===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s>
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=key, reverse=reverse
)
return identify_obj
===========changed ref 2===========
# module: tests.test_identifier
def test_identifier_sorting3():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.NAME)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev <= match["Regex Pattern"]["Name"]
prev = match["Regex Pattern"]["Name"]
===========changed ref 3===========
# module: tests.test_identifier
def test_identifier_works3():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Dogecoin (DOGE) Wallet Address" in str(out)
===========changed ref 4===========
# module: tests.test_identifier
def test_identifier_works2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Ethereum (ETH) Wallet Address" in str(out)
===========changed ref 5===========
# module: tests.test_identifier
def test_identifier_sorting2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.RARITY, reverse=True)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev >= match["Regex Pattern"]["Rarity"]
prev = match["Regex Pattern"]["Rarity"]
===========changed ref 6===========
# module: tests.test_identifier
def test_identifier_works():
- r = identifier.Identifier()
out = r.identify("DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o")
assert (
"Dogecoin (DOGE) Wallet Address"
in out["Regexes"]["text"][0]["Regex Pattern"]["Name"]
)
===========changed ref 7===========
# module: tests.test_filtration
+ regexes = load_regexes()
===========changed ref 8===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 9===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 10===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 11===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 12===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_youtube_id2():
- r = regex_identifier.RegexIdentifier()
res = r.check(["078-05-1120"])
assert "YouTube Video ID" not in res
===========changed ref 15===========
# module: tests.test_regex_identifier
def test_invalid_tld():
- r = regex_identifier.RegexIdentifier()
res = r.check(["tryhackme.comm"])
assert "Uniform Resource Locator (URL)" not in res
|
tests.test_identifier/test_identifier_sorting6
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = identifier.Identifier()
|
# module: tests.test_identifier
def test_identifier_sorting6():
<0> r = identifier.Identifier()
<1> out = r.identify("fixtures/file", only_text=False, key=Keys.MATCHED, reverse=True)
<2> prev = None
<3> for match in out["Regexes"]["file"]:
<4> if prev is not None:
<5> assert prev >= match["Matched"]
<6> prev = match["Matched"]
<7>
|
===========unchanged ref 0===========
at: pywhat.helper
Keys()
at: pywhat.identifier
Identifier(*, dist: Optional[Distribution]=None, key: Callable=Keys.NONE, reverse=False, boundaryless: Optional[Filter]=None)
at: pywhat.identifier.Identifier
identify(text: str, *, only_text=True, dist: Distribution=None, key: Optional[Callable]=None, reverse: Optional[bool]=None, boundaryless: Optional[Filter]=None, include_filenames=False) -> dict
===========changed ref 0===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
+
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
regex = self._regex_id.check(contents, dist)
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)</s>
===========changed ref 1===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s>
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=key, reverse=reverse
)
return identify_obj
===========changed ref 2===========
# module: tests.test_identifier
def test_identifier_sorting5():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.MATCHED)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev <= match["Matched"]
prev = match["Matched"]
===========changed ref 3===========
# module: tests.test_identifier
def test_identifier_sorting3():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.NAME)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev <= match["Regex Pattern"]["Name"]
prev = match["Regex Pattern"]["Name"]
===========changed ref 4===========
# module: tests.test_identifier
def test_identifier_works3():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Dogecoin (DOGE) Wallet Address" in str(out)
===========changed ref 5===========
# module: tests.test_identifier
def test_identifier_works2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Ethereum (ETH) Wallet Address" in str(out)
===========changed ref 6===========
# module: tests.test_identifier
def test_identifier_sorting2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.RARITY, reverse=True)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev >= match["Regex Pattern"]["Rarity"]
prev = match["Regex Pattern"]["Rarity"]
===========changed ref 7===========
# module: tests.test_identifier
def test_identifier_works():
- r = identifier.Identifier()
out = r.identify("DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o")
assert (
"Dogecoin (DOGE) Wallet Address"
in out["Regexes"]["text"][0]["Regex Pattern"]["Name"]
)
===========changed ref 8===========
# module: tests.test_filtration
+ regexes = load_regexes()
===========changed ref 9===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 10===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 11===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 12===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
===========changed ref 13===========
# module: tests.test_regex_identifier
def test_regex_successfully_parses():
- r = regex_identifier.RegexIdentifier()
assert "Name" in r.distribution.get_regexes()[0]
===========changed ref 14===========
# module: tests.test_regex_identifier
def test_email4():
- r = regex_identifier.RegexIdentifier()
res = r.check(["email@[email protected]"])
assert "Email Address" not in res
|
tests.test_identifier/test_only_text
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = identifier.Identifier()
|
# module: tests.test_identifier
def test_only_text():
<0> r = identifier.Identifier()
<1> out = r.identify("fixtures/file")
<2> assert None == out["Regexes"]
<3>
<4> out = r.identify("THM{7281j}}", only_text=True)
<5> assert "TryHackMe Flag Format" in out["Regexes"]["text"][0]["Regex Pattern"]["Name"]
<6>
|
===========unchanged ref 0===========
at: pywhat.identifier
Identifier(*, dist: Optional[Distribution]=None, key: Callable=Keys.NONE, reverse=False, boundaryless: Optional[Filter]=None)
at: pywhat.identifier.Identifier
identify(text: str, *, only_text=True, dist: Distribution=None, key: Optional[Callable]=None, reverse: Optional[bool]=None, boundaryless: Optional[Filter]=None, include_filenames=False) -> dict
===========changed ref 0===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
+
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
regex = self._regex_id.check(contents, dist)
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)</s>
===========changed ref 1===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s>
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=key, reverse=reverse
)
return identify_obj
===========changed ref 2===========
# module: tests.test_identifier
def test_identifier_sorting6():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.MATCHED, reverse=True)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev >= match["Matched"]
prev = match["Matched"]
===========changed ref 3===========
# module: tests.test_identifier
def test_identifier_sorting5():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.MATCHED)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev <= match["Matched"]
prev = match["Matched"]
===========changed ref 4===========
# module: tests.test_identifier
def test_identifier_sorting3():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.NAME)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev <= match["Regex Pattern"]["Name"]
prev = match["Regex Pattern"]["Name"]
===========changed ref 5===========
# module: tests.test_identifier
def test_identifier_works3():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Dogecoin (DOGE) Wallet Address" in str(out)
===========changed ref 6===========
# module: tests.test_identifier
def test_identifier_works2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Ethereum (ETH) Wallet Address" in str(out)
===========changed ref 7===========
# module: tests.test_identifier
def test_identifier_sorting2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.RARITY, reverse=True)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev >= match["Regex Pattern"]["Rarity"]
prev = match["Regex Pattern"]["Rarity"]
===========changed ref 8===========
# module: tests.test_identifier
def test_identifier_works():
- r = identifier.Identifier()
out = r.identify("DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o")
assert (
"Dogecoin (DOGE) Wallet Address"
in out["Regexes"]["text"][0]["Regex Pattern"]["Name"]
)
===========changed ref 9===========
# module: tests.test_filtration
+ regexes = load_regexes()
===========changed ref 10===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 11===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
===========changed ref 12===========
# module: pywhat.magic_numbers
+
+ try:
+ import orjson as json
+ except ImportError:
+ import json
===========changed ref 13===========
# module: tests.test_filtration
@pytest.mark.skip(
"Dist.get_regexes() returns the regex list with the default filter of 0.1:1. \
load_regexes() returns all regex without that filter. \
This fails because one of them is filtered and the other is not."
)
def test_distribution():
dist = Distribution()
- regexes = load_regexes()
assert regexes == dist.get_regexes()
|
tests.test_identifier/test_recursion
|
Modified
|
bee-san~pyWhat
|
69425bb20360a6b57a8f22d43c9a31a33564d9c4
|
Merge branch 'main' into subcategories
|
<0>:<del> r = identifier.Identifier()
|
# module: tests.test_identifier
def test_recursion():
<0> r = identifier.Identifier()
<1> out = r.identify("fixtures", only_text=False)
<2>
<3> assert re.findall(r"\'(?:\/|\\\\)file\'", str(list(out["Regexes"].keys())))
<4> assert re.findall(
<5> r"\'(?:\/|\\\\)test(?:\/|\\\\)file\'", str(list(out["Regexes"].keys()))
<6> )
<7>
|
===========unchanged ref 0===========
at: pywhat.identifier
Identifier(*, dist: Optional[Distribution]=None, key: Callable=Keys.NONE, reverse=False, boundaryless: Optional[Filter]=None)
at: pywhat.identifier.Identifier
identify(text: str, *, only_text=True, dist: Distribution=None, key: Optional[Callable]=None, reverse: Optional[bool]=None, boundaryless: Optional[Filter]=None, include_filenames=False) -> dict
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
+
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
regex = self._regex_id.check(contents, dist)
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)</s>
===========changed ref 1===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s>
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=key, reverse=reverse
)
return identify_obj
===========changed ref 2===========
# module: tests.test_identifier
def test_only_text():
- r = identifier.Identifier()
out = r.identify("fixtures/file")
assert None == out["Regexes"]
out = r.identify("THM{7281j}}", only_text=True)
assert "TryHackMe Flag Format" in out["Regexes"]["text"][0]["Regex Pattern"]["Name"]
===========changed ref 3===========
# module: tests.test_identifier
def test_identifier_sorting6():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.MATCHED, reverse=True)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev >= match["Matched"]
prev = match["Matched"]
===========changed ref 4===========
# module: tests.test_identifier
def test_identifier_sorting5():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.MATCHED)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev <= match["Matched"]
prev = match["Matched"]
===========changed ref 5===========
# module: tests.test_identifier
def test_identifier_sorting3():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.NAME)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev <= match["Regex Pattern"]["Name"]
prev = match["Regex Pattern"]["Name"]
===========changed ref 6===========
# module: tests.test_identifier
def test_identifier_works3():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Dogecoin (DOGE) Wallet Address" in str(out)
===========changed ref 7===========
# module: tests.test_identifier
def test_identifier_works2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False)
assert "Ethereum (ETH) Wallet Address" in str(out)
===========changed ref 8===========
# module: tests.test_identifier
def test_identifier_sorting2():
- r = identifier.Identifier()
out = r.identify("fixtures/file", only_text=False, key=Keys.RARITY, reverse=True)
prev = None
for match in out["Regexes"]["file"]:
if prev is not None:
assert prev >= match["Regex Pattern"]["Rarity"]
prev = match["Regex Pattern"]["Rarity"]
===========changed ref 9===========
# module: tests.test_identifier
def test_identifier_works():
- r = identifier.Identifier()
out = r.identify("DANHz6EQVoWyZ9rER56DwTXHWUxfkv9k2o")
assert (
"Dogecoin (DOGE) Wallet Address"
in out["Regexes"]["text"][0]["Regex Pattern"]["Name"]
)
===========changed ref 10===========
# module: tests.test_filtration
+ regexes = load_regexes()
===========changed ref 11===========
# module: tests.test_regex_identifier
+ database = load_regexes()
+ r = regex_identifier.RegexIdentifier()
===========changed ref 12===========
# module: pywhat.helper
"""Helper utilities"""
+ try:
+ import orjson as json
+ except ImportError:
+ import json
+
|
pywhat.regex_identifier/RegexIdentifier.check
|
Modified
|
bee-san~pyWhat
|
4e98bfe87c39d125c385dc03776dccea0197e66a
|
Remove children data from identify() return object
|
<47>:<add> reg.pop("Children", None)
|
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
<0> if dist is None:
<1> dist = self.distribution
<2> if boundaryless is None:
<3> boundaryless = Filter({"Tags": []})
<4> matches = []
<5>
<6> for string in text:
<7> for reg in dist.get_regexes():
<8> regex = (
<9> reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
<10> )
<11>
<12> for matched_regex in re.finditer(regex, string, re.MULTILINE):
<13> reg = copy.copy(reg)
<14> matched = self.clean_text(matched_regex.group(0))
<15>
<16> children = reg.get("Children")
<17> if children is not None:
<18> processed_match = re.sub(
<19> children.get("deletion_pattern", ""), "", matched
<20> )
<21> matched_children = []
<22> if children["method"] == "hashmap":
<23> for length in children["lengths"]:
<24> try:
<25> matched_children.append(
<26> children["Items"][processed_match[:length]]
<27> )
<28> except KeyError:
<29> continue
<30> else:
<31> for element in children["Items"]:
<32> if (
<33> children["method"] == "regex"
<34> and re.search(
<35> element, processed_match, re.MULTILINE
<36> )
<37> ) or (
<38> children["method"] == "startswith"
<39> and processed_match.startswith(element)
<40> ):
<41> matched_children.append(children["Items"][element])
<42>
<43> if matched_children:
<44> reg["Description"] = children.get("entry", "") + ", ".join(
<45> matched_children
<46> )
<47>
<48> matches.append(
<49> {
<50> </s>
|
===========below chunk 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
"Regex Pattern": reg,
}
)
return matches
===========unchanged ref 0===========
at: copy
copy(x: _T) -> _T
at: pywhat.filter
Filter(filters_dict: Optional[Mapping]=None)
Distribution(filter: Optional[Filter]=None)
at: pywhat.filter.Distribution
get_regexes()
at: pywhat.regex_identifier.RegexIdentifier
clean_text(text)
at: pywhat.regex_identifier.RegexIdentifier.__init__
self.distribution = Distribution()
at: re
MULTILINE = RegexFlag.MULTILINE
search(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> Optional[Match[AnyStr]]
search(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> Optional[Match[AnyStr]]
sub(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int=..., flags: _FlagsType=...) -> AnyStr
sub(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int=..., flags: _FlagsType=...) -> AnyStr
sub(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int=..., flags: _FlagsType=...) -> AnyStr
sub(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int=..., flags: _FlagsType=...) -> AnyStr
finditer(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> Iterator[Match[AnyStr]]
finditer(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> Iterator[Match[AnyStr]]
at: typing.Match
pos: int
endpos: int
lastindex: Optional[int]
lastgroup: Optional[AnyStr]
string: AnyStr
re: Pattern[AnyStr]
===========unchanged ref 1===========
group(group1: Union[str, int], group2: Union[str, int], /, *groups: Union[str, int]) -> Tuple[AnyStr, ...]
group(group: Union[str, int]=..., /) -> AnyStr
|
tests.test_click/test_json_printing
|
Modified
|
bee-san~pyWhat
|
fe12748977b02a2a6cc52b4873c19c35329645df
|
Fix for --json command option
|
<3>:<add> assert json.loads(result.output.replace("\n", ""))
<del> assert json.loads(result.output, strict=False)
|
# module: tests.test_click
def test_json_printing():
<0> """Test for valid json"""
<1> runner = CliRunner()
<2> result = runner.invoke(main, ["10.0.0.1", "--json"])
<3> assert json.loads(result.output, strict=False)
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: json
loads(s: Union[str, bytes], *, cls: Optional[Type[JSONDecoder]]=..., object_hook: Optional[Callable[[Dict[Any, Any]], Any]]=..., parse_float: Optional[Callable[[str], Any]]=..., parse_int: Optional[Callable[[str], Any]]=..., parse_constant: Optional[Callable[[str], Any]]=..., object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]]=..., **kwds: Any) -> Any
at: pywhat.what
main(**kwargs)
|
tests.test_regex_identifier/test_stripe_api_key
|
Modified
|
bee-san~pyWhat
|
dcb5b0a8cf9ccb935b9096b933567824bea85643
|
Add tests and update README
|
<0>:<add> res = r.check(["sk_live_26PHem9AhJZvU623DfE1x4sd"])
<del> res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
|
# module: tests.test_regex_identifier
def test_stripe_api_key():
<0> res = r.check(["sk_live_vHDDrL02ioRF5vYtyqiYBKma"])
<1> _assert_match_first_item("Stripe API Key", res)
<2>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
===========changed ref 0===========
# module: tests.test_regex_identifier
+ def _assert_match_in_items(name, res):
+ for i in res:
+ if i["Regex Pattern"]["Name"] == name:
+ assert True
+ else:
+ assert False
+
|
tests.test_regex_identifier/_assert_match_in_items
|
Modified
|
bee-san~pyWhat
|
c8f35d5f69796ecf00cb24ffe165c275febf3457
|
Update README and improve readability
|
<1>:<add> assert i["Regex Pattern"]["Name"] == name
<del> if i["Regex Pattern"]["Name"] == name:
<2>:<del> assert True
<3>:<del> else:
<4>:<del> assert False
|
# module: tests.test_regex_identifier
def _assert_match_in_items(name, res):
<0> for i in res:
<1> if i["Regex Pattern"]["Name"] == name:
<2> assert True
<3> else:
<4> assert False
<5>
| |
pywhat.what/main
|
Modified
|
bee-san~pyWhat
|
3e78fc06b5b54dade0dcfc92f590699f3ab30ab9
|
Merge branch 'bee-bug-bounty' of github.com:bee-san/pyWhat into bee-bug-bounty
|
<s>
"--version",
is_flag=True,
callback=print_version,
help="Display the version of pywhat.",
)
@click.option(
"-if",
"--include-filenames",
is_flag=True,
help="Search filenames for possible matches.",
)
+ @click.option("--format", required = False, help="--format json for json output. --format pretty for a pretty table output.")
def main(**kwargs):
<0> """
<1> pyWhat - Identify what something is.
<2>
<3> Made by Bee https://twitter.com/bee_sec_san
<4>
<5> https://github.com/bee-san
<6>
<7> Filtration:
<8>
<9> --rarity min:max
<10>
<11> Rarity is how unlikely something is to be a false-positive. The higher the number, the more unlikely.
<12>
<13> Only print entries with rarity in range [min,max]. min and max can be omitted.
<14>
<15> Note: PyWhat by default has a rarity of 0.1. To see all matches, with many potential false positives use `0:`.
<16>
<17> --include list
<18>
<19> Only include entries containing at least one tag in a list. List is a comma separated list.
<20>
<21> --exclude list
<22>
<23> Exclude specified tags. List is a comma separated list.
<24>
<25> Sorting:
<26>
<27> --key key_name
<28>
<29> Sort by the given key.
<30>
<31> --reverse
<32>
<33> Sort in reverse order.
<34>
<35> Available keys:
<36>
<37> name - Sort by the name of regex pattern
<38>
<39> rarity - Sort by rarity
<40>
<41> matched - Sort by a matched string
<42>
<43> none - No sorting is done (the default)
<44>
<45> Exporting:
<46>
</s>
|
===========below chunk 0===========
<s>
is_flag=True,
callback=print_version,
help="Display the version of pywhat.",
)
@click.option(
"-if",
"--include-filenames",
is_flag=True,
help="Search filenames for possible matches.",
)
+ @click.option("--format", required = False, help="--format json for json output. --format pretty for a pretty table output.")
def main(**kwargs):
# offset: 1
Return results in json format.
Boundaryless mode:
CLI tool matches strings like 'abcdTHM{hello}plze' by default because the boundaryless mode is enabled for regexes with a rarity of 0.1 and higher.
Since boundaryless mode may produce a lot of false-positive matches, it is possible to disable it, either fully or partially.
'--disable-boundaryless' flag can be used to fully disable this mode.
In addition, '-br', '-bi', and '-be' options can be used to tweak which regexes should be in boundaryless mode.
Refer to the Filtration section for more information.
Examples:
* what 'HTB{this is a flag}'
* what '0x52908400098527886E0F7030069857D2E4169EE7'
* what -- '52.6169586, -1.9779857'
* what --rarity 0.6: '[email protected]'
* what --rarity 0: --include "credentials, username, password" --exclude "aws, credentials" 'James:SecretPassword'
* what -br 0.6: -be URL '[email protected]'
Your text must either be in quotation marks, or use the POSIX standard of "--" to mean "anything after -- is textual input".
pyWhat can also search files or</s>
===========below chunk 1===========
<s>
is_flag=True,
callback=print_version,
help="Display the version of pywhat.",
)
@click.option(
"-if",
"--include-filenames",
is_flag=True,
help="Search filenames for possible matches.",
)
+ @click.option("--format", required = False, help="--format json for json output. --format pretty for a pretty table output.")
def main(**kwargs):
# offset: 2
<s> POSIX standard of "--" to mean "anything after -- is textual input".
pyWhat can also search files or even a whole directory with recursion:
* what 'secret.txt'
* what 'this/is/a/path'
"""
dist = Distribution(
create_filter(kwargs["rarity"], kwargs["include"], kwargs["exclude"])
)
if kwargs["disable_boundaryless"]:
boundaryless = Filter({"Tags": []}) # use empty filter
else:
boundaryless = create_filter(
kwargs["boundaryless_rarity"],
kwargs["boundaryless_include"],
kwargs["boundaryless_exclude"],
)
what_obj = What_Object(dist)
if kwargs["key"] is None:
key = Keys.NONE
else:
try:
key = str_to_key(kwargs["key"])
except ValueError:
print("Invalid key")
sys.exit(1)
identified_output = what_obj.what_is_this(
kwargs["text_input"],
kwargs["only_text"],
key,
kwargs["reverse"],
boundaryless,
kwargs["include_filenames"],
)
p = printer.Printing</s>
===========below chunk 2===========
<s>
is_flag=True,
callback=print_version,
help="Display the version of pywhat.",
)
@click.option(
"-if",
"--include-filenames",
is_flag=True,
help="Search filenames for possible matches.",
)
+ @click.option("--format", required = False, help="--format json for json output. --format pretty for a pretty table output.")
def main(**kwargs):
# offset: 3
<s>
if kwargs["json"]:
p.print_json(identified_output)
else:
p.pretty_print(identified_output, kwargs["text_input"])
===========unchanged ref 0===========
at: click.decorators
command(name: Optional[str]=..., cls: Optional[Type[Command]]=..., context_settings: Optional[Dict[Any, Any]]=..., help: Optional[str]=..., epilog: Optional[str]=..., short_help: Optional[str]=..., options_metavar: str=..., add_help_option: bool=..., hidden: bool=..., deprecated: bool=...) -> Callable[[Callable[..., Any]], Command]
argument(*param_decls: Text, cls: Type[Argument]=..., required: Optional[bool]=..., type: Optional[_ConvertibleType]=..., default: Optional[Any]=..., callback: Optional[_Callback]=..., nargs: Optional[int]=..., metavar: Optional[str]=..., expose_value: bool=..., is_eager: bool=..., envvar: Optional[Union[str, List[str]]]=..., autocompletion: Optional[Callable[[Any, List[str], str], List[Union[str, Tuple[str, str]]]]]=...) -> _IdentityFunction
===========unchanged ref 1===========
option(*param_decls: str, cls: Type[Option]=..., show_default: Union[bool, Text]=..., prompt: Union[bool, Text]=..., confirmation_prompt: bool=..., hide_input: bool=..., is_flag: Optional[bool]=..., flag_value: Optional[Any]=..., multiple: bool=..., count: bool=..., allow_from_autoenv: bool=..., type: _T=..., help: Optional[str]=..., show_choices: bool=..., default: Optional[Any]=..., required: bool=..., callback: Optional[Callable[[Context, Union[Option, Parameter], Union[bool, int, str]], _T]]=..., nargs: Optional[int]=..., metavar: Optional[str]=..., expose_value: bool=..., is_eager: bool=..., envvar: Optional[Union[str, List[str]]]=..., **kwargs: Any) -> _IdentityFunction
option(*param_decls: str, cls: Type[Option]=..., show_default: Union[bool, Text]=..., prompt: Union[bool, Text]=..., confirmation_prompt: bool=..., hide_input: bool=..., is_flag: Optional[bool]=..., flag_value: Optional[Any]=..., multiple: bool=..., count: bool=..., allow_from_autoenv: bool=..., type: Type[int]=..., help: Optional[str]=..., show_choices: bool=..., default: Optional[Any]=..., required: bool=..., callback: Callable[[Context, Union[Option, Parameter], int], Any]=..., nargs: Optional[int]=..., metavar: Optional[str]=..., expose_value: bool=..., is_eager: bool=..., envvar: Optional[Union[str, List[str]]]=..., **kwargs: Any) -> _IdentityFunction
option(*param_decls: Text, cls: Type[Option]=..., show_default: Union[bool, Text]=..., prompt: Union[bool, Text]=..., confirmation_prompt: bool=...,</s>
|
|
pywhat.printer/Printing.__init__
|
Modified
|
bee-san~pyWhat
|
3e78fc06b5b54dade0dcfc92f590699f3ab30ab9
|
Merge branch 'bee-bug-bounty' of github.com:bee-san/pyWhat into bee-bug-bounty
|
<1>:<add> self.bug_bounty_mode = False
|
# module: pywhat.printer
class Printing:
def __init__(self):
<0> self.console = Console(highlight=False)
<1>
|
===========changed ref 0===========
<s>
"--version",
is_flag=True,
callback=print_version,
help="Display the version of pywhat.",
)
@click.option(
"-if",
"--include-filenames",
is_flag=True,
help="Search filenames for possible matches.",
)
+ @click.option("--format", required = False, help="--format json for json output. --format pretty for a pretty table output.")
def main(**kwargs):
"""
pyWhat - Identify what something is.
Made by Bee https://twitter.com/bee_sec_san
https://github.com/bee-san
Filtration:
--rarity min:max
Rarity is how unlikely something is to be a false-positive. The higher the number, the more unlikely.
Only print entries with rarity in range [min,max]. min and max can be omitted.
Note: PyWhat by default has a rarity of 0.1. To see all matches, with many potential false positives use `0:`.
--include list
Only include entries containing at least one tag in a list. List is a comma separated list.
--exclude list
Exclude specified tags. List is a comma separated list.
Sorting:
--key key_name
Sort by the given key.
--reverse
Sort in reverse order.
Available keys:
name - Sort by the name of regex pattern
rarity - Sort by rarity
matched - Sort by a matched string
none - No sorting is done (the default)
Exporting:
--json
Return results in json format.
Boundaryless mode:
CLI tool matches strings like 'abcdTHM{hello}plze' by default because</s>
===========changed ref 1===========
<s>
is_flag=True,
callback=print_version,
help="Display the version of pywhat.",
)
@click.option(
"-if",
"--include-filenames",
is_flag=True,
help="Search filenames for possible matches.",
)
+ @click.option("--format", required = False, help="--format json for json output. --format pretty for a pretty table output.")
def main(**kwargs):
# offset: 1
<s>
Boundaryless mode:
CLI tool matches strings like 'abcdTHM{hello}plze' by default because the boundaryless mode is enabled for regexes with a rarity of 0.1 and higher.
Since boundaryless mode may produce a lot of false-positive matches, it is possible to disable it, either fully or partially.
'--disable-boundaryless' flag can be used to fully disable this mode.
In addition, '-br', '-bi', and '-be' options can be used to tweak which regexes should be in boundaryless mode.
Refer to the Filtration section for more information.
Examples:
* what 'HTB{this is a flag}'
* what '0x52908400098527886E0F7030069857D2E4169EE7'
* what -- '52.6169586, -1.9779857'
* what --rarity 0.6: '[email protected]'
* what --rarity 0: --include "credentials, username, password" --exclude "aws, credentials" 'James:SecretPassword'
* what -br 0.6: -be URL '[email protected]'
Your text must either be in quotation marks, or use the POSIX standard of "--" to mean "any</s>
===========changed ref 2===========
<s>
is_flag=True,
callback=print_version,
help="Display the version of pywhat.",
)
@click.option(
"-if",
"--include-filenames",
is_flag=True,
help="Search filenames for possible matches.",
)
+ @click.option("--format", required = False, help="--format json for json output. --format pretty for a pretty table output.")
def main(**kwargs):
# offset: 2
<s> -- is textual input".
pyWhat can also search files or even a whole directory with recursion:
* what 'secret.txt'
* what 'this/is/a/path'
"""
dist = Distribution(
create_filter(kwargs["rarity"], kwargs["include"], kwargs["exclude"])
)
if kwargs["disable_boundaryless"]:
boundaryless = Filter({"Tags": []}) # use empty filter
else:
boundaryless = create_filter(
kwargs["boundaryless_rarity"],
kwargs["boundaryless_include"],
kwargs["boundaryless_exclude"],
)
what_obj = What_Object(dist)
if kwargs["key"] is None:
key = Keys.NONE
else:
try:
key = str_to_key(kwargs["key"])
except ValueError:
print("Invalid key")
sys.exit(1)
identified_output = what_obj.what_is_this(
kwargs["text_input"],
kwargs["only_text"],
key,
kwargs["reverse"],
boundaryless,
kwargs["include_filenames"],
)
p = printer.Printing()
+ if kwargs["json</s>
===========changed ref 3===========
<s>
is_flag=True,
callback=print_version,
help="Display the version of pywhat.",
)
@click.option(
"-if",
"--include-filenames",
is_flag=True,
help="Search filenames for possible matches.",
)
+ @click.option("--format", required = False, help="--format json for json output. --format pretty for a pretty table output.")
def main(**kwargs):
# offset: 3
<s> kwargs["format"] == "json":
- if kwargs["json"]:
p.print_json(identified_output)
+ elif kwargs["format"] == "pretty":
+ p.pretty_print(identified_output, kwargs["text_input"])
-
else:
+ p.print_raw(identified_output, kwargs["text_input"])
- p.pretty_print(identified_output, kwargs["text_input"])
|
pywhat.printer/Printing.pretty_print
|
Modified
|
bee-san~pyWhat
|
3e78fc06b5b54dade0dcfc92f590699f3ab30ab9
|
Merge branch 'bee-bug-bounty' of github.com:bee-san/pyWhat into bee-bug-bounty
|
<19>:<add> if self._check_if_directory(text_input):
<del> if os.path.isdir(text_input):
<22>:<add>
<add> # Check if there are any bug bounties with exploits
<add> # in the regex
<add> if self._check_if_exploit_in_json(text):
<add> table.add_column("Exploit", overflow="fold")
|
# module: pywhat.printer
class Printing:
def pretty_print(self, text: dict, text_input):
<0> to_out = ""
<1>
<2> if text["File Signatures"] and text["Regexes"]:
<3> for key, value in text["File Signatures"].items():
<4> if value:
<5> to_out += "\n"
<6> to_out += f"[bold #D7Afff]File Identified[/bold #D7Afff]: [bold]{key}[/bold] with Magic Numbers {value['ISO 8859-1']}."
<7> to_out += f"\n[bold #D7Afff]File Description:[/bold #D7Afff] {value['Description']}."
<8> to_out += "\n"
<9>
<10> if text["Regexes"]:
<11> to_out += "\n[bold #D7Afff]Possible Identification[/bold #D7Afff]"
<12> table = Table(
<13> show_header=True, header_style="bold #D7Afff", show_lines=True
<14> )
<15> table.add_column("Matched Text", overflow="fold")
<16> table.add_column("Identified as", overflow="fold")
<17> table.add_column("Description", overflow="fold")
<18>
<19> if os.path.isdir(text_input):
<20> # if input is a folder, add a filename column
<21> table.add_column("File", overflow="fold")
<22>
<23> for key, value in text["Regexes"].items():
<24> for i in value:
<25> matched = i["Matched"]
<26> name = i["Regex Pattern"]["Name"]
<27> description = None
<28> filename = key
<29>
<30> if "URL" in i["Regex Pattern"] and i["Regex Pattern"]["URL"]:
<31> description = (
<32> "Click here to analyse in the browser\n"
<33> + i["Regex Pattern"]["URL"]
<34> + matched.replace(" ", "")
<35> )
<36>
<37> if i["Regex Pattern"]["Description"]:
<38> </s>
|
===========below chunk 0===========
# module: pywhat.printer
class Printing:
def pretty_print(self, text: dict, text_input):
# offset: 1
description = (
description + "\n" + i["Regex Pattern"]["Description"]
)
else:
description = i["Regex Pattern"]["Description"]
if not description:
description = "None"
if os.path.isdir(text_input):
table.add_row(
matched,
name,
description,
filename,
)
else:
table.add_row(
matched,
name,
description,
)
self.console.print(to_out, table)
if to_out == "":
self.console.print("Nothing found!")
===========unchanged ref 0===========
at: pywhat.printer.Printing
_check_if_exploit_in_json(text: dict) -> bool
_check_if_directory(text_input)
at: pywhat.printer.Printing._check_if_exploit_in_json
self.bug_bounty_mode = True
===========changed ref 0===========
# module: pywhat.printer
class Printing:
def __init__(self):
self.console = Console(highlight=False)
+ self.bug_bounty_mode = False
===========changed ref 1===========
<s>
"--version",
is_flag=True,
callback=print_version,
help="Display the version of pywhat.",
)
@click.option(
"-if",
"--include-filenames",
is_flag=True,
help="Search filenames for possible matches.",
)
+ @click.option("--format", required = False, help="--format json for json output. --format pretty for a pretty table output.")
def main(**kwargs):
"""
pyWhat - Identify what something is.
Made by Bee https://twitter.com/bee_sec_san
https://github.com/bee-san
Filtration:
--rarity min:max
Rarity is how unlikely something is to be a false-positive. The higher the number, the more unlikely.
Only print entries with rarity in range [min,max]. min and max can be omitted.
Note: PyWhat by default has a rarity of 0.1. To see all matches, with many potential false positives use `0:`.
--include list
Only include entries containing at least one tag in a list. List is a comma separated list.
--exclude list
Exclude specified tags. List is a comma separated list.
Sorting:
--key key_name
Sort by the given key.
--reverse
Sort in reverse order.
Available keys:
name - Sort by the name of regex pattern
rarity - Sort by rarity
matched - Sort by a matched string
none - No sorting is done (the default)
Exporting:
--json
Return results in json format.
Boundaryless mode:
CLI tool matches strings like 'abcdTHM{hello}plze' by default because</s>
===========changed ref 2===========
<s>
is_flag=True,
callback=print_version,
help="Display the version of pywhat.",
)
@click.option(
"-if",
"--include-filenames",
is_flag=True,
help="Search filenames for possible matches.",
)
+ @click.option("--format", required = False, help="--format json for json output. --format pretty for a pretty table output.")
def main(**kwargs):
# offset: 1
<s>
Boundaryless mode:
CLI tool matches strings like 'abcdTHM{hello}plze' by default because the boundaryless mode is enabled for regexes with a rarity of 0.1 and higher.
Since boundaryless mode may produce a lot of false-positive matches, it is possible to disable it, either fully or partially.
'--disable-boundaryless' flag can be used to fully disable this mode.
In addition, '-br', '-bi', and '-be' options can be used to tweak which regexes should be in boundaryless mode.
Refer to the Filtration section for more information.
Examples:
* what 'HTB{this is a flag}'
* what '0x52908400098527886E0F7030069857D2E4169EE7'
* what -- '52.6169586, -1.9779857'
* what --rarity 0.6: '[email protected]'
* what --rarity 0: --include "credentials, username, password" --exclude "aws, credentials" 'James:SecretPassword'
* what -br 0.6: -be URL '[email protected]'
Your text must either be in quotation marks, or use the POSIX standard of "--" to mean "any</s>
===========changed ref 3===========
<s>
is_flag=True,
callback=print_version,
help="Display the version of pywhat.",
)
@click.option(
"-if",
"--include-filenames",
is_flag=True,
help="Search filenames for possible matches.",
)
+ @click.option("--format", required = False, help="--format json for json output. --format pretty for a pretty table output.")
def main(**kwargs):
# offset: 2
<s> -- is textual input".
pyWhat can also search files or even a whole directory with recursion:
* what 'secret.txt'
* what 'this/is/a/path'
"""
dist = Distribution(
create_filter(kwargs["rarity"], kwargs["include"], kwargs["exclude"])
)
if kwargs["disable_boundaryless"]:
boundaryless = Filter({"Tags": []}) # use empty filter
else:
boundaryless = create_filter(
kwargs["boundaryless_rarity"],
kwargs["boundaryless_include"],
kwargs["boundaryless_exclude"],
)
what_obj = What_Object(dist)
if kwargs["key"] is None:
key = Keys.NONE
else:
try:
key = str_to_key(kwargs["key"])
except ValueError:
print("Invalid key")
sys.exit(1)
identified_output = what_obj.what_is_this(
kwargs["text_input"],
kwargs["only_text"],
key,
kwargs["reverse"],
boundaryless,
kwargs["include_filenames"],
)
p = printer.Printing()
+ if kwargs["json</s>
|
pywhat.printer/Printing.pretty_print
|
Modified
|
bee-san~pyWhat
|
34e9790d056198c8a53ea2e16c91b490ed889966
|
Cleaned up the printing and tests pass
|
<7>:<add> to_out += f"\n[bold #D7Afff]File Description: [/bold #D7Afff] {value['Description']}."
<del> to_out += f"\n[bold #D7Afff]File Description:[/bold #D7Afff] {value['Description']}."
<8>:<add> to_out += "\n\n"
<del> to_out += "\n"
<11>:<add> to_out += "\n[bold #D7Afff]Possible Identification[/bold #D7Afff]\n"
<del> to_out += "\n[bold #D7Afff]Possible Identification[/bold #D7Afff]"
<25>:<add> self._check_if_exploit_in_json(text)
<del> if self._check_if_exploit_in_json(text):
<26>:<add> if self.bug_bounty_mode:
<34>:<add> exploit = None
|
# module: pywhat.printer
class Printing:
def pretty_print(self, text: dict, text_input):
<0> to_out = ""
<1>
<2> if text["File Signatures"] and text["Regexes"]:
<3> for key, value in text["File Signatures"].items():
<4> if value:
<5> to_out += "\n"
<6> to_out += f"[bold #D7Afff]File Identified[/bold #D7Afff]: [bold]{key}[/bold] with Magic Numbers {value['ISO 8859-1']}."
<7> to_out += f"\n[bold #D7Afff]File Description:[/bold #D7Afff] {value['Description']}."
<8> to_out += "\n"
<9>
<10> if text["Regexes"]:
<11> to_out += "\n[bold #D7Afff]Possible Identification[/bold #D7Afff]"
<12> table = Table(
<13> show_header=True, header_style="bold #D7Afff", show_lines=True
<14> )
<15> table.add_column("Matched Text", overflow="fold")
<16> table.add_column("Identified as", overflow="fold")
<17> table.add_column("Description", overflow="fold")
<18>
<19> if self._check_if_directory(text_input):
<20> # if input is a folder, add a filename column
<21> table.add_column("File", overflow="fold")
<22>
<23> # Check if there are any bug bounties with exploits
<24> # in the regex
<25> if self._check_if_exploit_in_json(text):
<26> table.add_column("Exploit", overflow="fold")
<27>
<28> for key, value in text["Regexes"].items():
<29> for i in value:
<30> matched = i["Matched"]
<31> name = i["Regex Pattern"]["Name"]
<32> description = None
<33> filename = key
<34>
<35> if "URL" in i["Regex Pattern"] and i["Regex Pattern"]["URL"]:
<36> </s>
|
===========below chunk 0===========
# module: pywhat.printer
class Printing:
def pretty_print(self, text: dict, text_input):
# offset: 1
"Click here to analyse in the browser\n"
+ i["Regex Pattern"]["URL"]
+ matched.replace(" ", "")
)
if i["Regex Pattern"]["Description"]:
if description:
description = (
description + "\n" + i["Regex Pattern"]["Description"]
)
else:
description = i["Regex Pattern"]["Description"]
if "Exploit" in i["Regex Pattern"] and i["Regex Pattern"]["Exploit"]:
exploit = i["Regex Pattern"]["Exploit"]
if not description:
description = "None"
#FIXME this is quite messy
if self.bug_bounty_mode:
if self._check_if_directory(text_input):
table.add_row(
matched,
name,
description,
filename,
exploit,
)
else:
table.add_row(
matched,
name,
description,
exploit,
)
else:
if self._check_if_directory(text_input):
table.add_row(
matched,
name,
description,
filename,
)
else:
table.add_row(
matched,
name,
description,
)
self.console.print(to_out, table)
if to_out == "":
self.console.print("Nothing found!")
===========unchanged ref 0===========
at: pywhat.printer.Printing
_check_if_exploit_in_json(self, text: dict) -> bool
_check_if_exploit_in_json(text: dict) -> bool
_check_if_directory(text_input)
at: pywhat.printer.Printing.__init__
self.bug_bounty_mode = False
at: pywhat.printer.Printing._check_if_exploit_in_json
self.bug_bounty_mode = True
===========changed ref 0===========
# module: pywhat
+ __version__ = "4.0.0"
- __version__ = "3.4.1"
pywhat_tags = AvailableTags().get_tags()
__all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
|
pywhat.printer/Printing.print_raw
|
Modified
|
bee-san~pyWhat
|
34e9790d056198c8a53ea2e16c91b490ed889966
|
Cleaned up the printing and tests pass
|
<12>:<del> output_str += "[bold #D7Afff]Possible Identification[/bold #D7Afff]\n"
<13>:<del>
<19>:<add> output_str += f"[bold #D7Afff]File: {key}[/bold #D7Afff]\n"
<del> output_str += f"[bold]File: {key}[/bold]\n"
<20>:<add> output_str += "[bold #D7Afff]Matched on: [/bold #D7Afff]" + i["Matched"]
<del> output_str += "[blue]Matched on: [/blue]" + i["Matched"]
<21>:<add> output_str += "\n[bold #D7Afff]Name: [/bold #D7Afff]" + i["Regex Pattern"]["Name"]
<del> output_str += "\nName: " + i["Regex Pattern"]["Name"]
<23>:<add> link = None
<24>:<add> link = (
<del> description = (
<25>:<add> "\n[bold #D7Afff]Link: [/bold #D7Afff] "
<del> "\n[Blue]Description: [/Blue] Click here to analyse in the browser\n"
<29>:<add>
<add> if link:
<add> output_str += link
<31>:<add> description = "\n[bold #D7Afff]Description: [/bold #D7Afff]" + i["Regex Pattern"]["Description"]
<add>
<add> if description:
<del> if description:
<32>:<add> output_str += description
<del> description = (
<33>:<del> description + "\n[Blue]Description: [/Blue] \n" + i["Regex Pattern"]["Description"]
<34>:<del> )
|
# module: pywhat.printer
class Printing:
def print_raw(self, text: dict, text_input) -> str:
<0> output_str = ""
<1>
<2> if text["File Signatures"] and text["Regexes"]:
<3> for key, value in text["File Signatures"].items():
<4> if value:
<5> output_str += "\n"
<6> output_str += f"[bold #D7Afff]File Identified[/bold #D7Afff]: [bold]{key}[/bold] with Magic Numbers {value['ISO 8859-1']}."
<7> output_str += f"\n[bold #D7Afff]File Description:[/bold #D7Afff] {value['Description']}."
<8> output_str += "\n"
<9>
<10>
<11> if text["Regexes"]:
<12> output_str += "[bold #D7Afff]Possible Identification[/bold #D7Afff]\n"
<13>
<14> for key, value in text["Regexes"].items():
<15> for i in value:
<16> description = None
<17> matched = i["Matched"]
<18> if self._check_if_directory(text_input):
<19> output_str += f"[bold]File: {key}[/bold]\n"
<20> output_str += "[blue]Matched on: [/blue]" + i["Matched"]
<21> output_str += "\nName: " + i["Regex Pattern"]["Name"]
<22>
<23> if "URL" in i["Regex Pattern"] and i["Regex Pattern"]["URL"]:
<24> description = (
<25> "\n[Blue]Description: [/Blue] Click here to analyse in the browser\n"
<26> + i["Regex Pattern"]["URL"]
<27> + matched.replace(" ", "")
<28> )
<29>
<30> if i["Regex Pattern"]["Description"]:
<31> if description:
<32> description = (
<33> description + "\n[Blue]Description: [/Blue] \n" + i["Regex Pattern"]["Description"]
<34> )
<35> else:
<36> description =</s>
|
===========below chunk 0===========
# module: pywhat.printer
class Printing:
def print_raw(self, text: dict, text_input) -> str:
# offset: 1
if "Exploit" in i["Regex Pattern"] and i["Regex Pattern"]["Exploit"]:
output_str += "\n[red]Exploit: [/red]" + i["Regex Pattern"]["Exploit"]
output_str += "\n\n"
if output_str == "":
self.console.print("Nothing found!")
self.console.print(output_str)
===========unchanged ref 0===========
at: pywhat.printer.Printing
_check_if_directory(text_input)
at: pywhat.printer.Printing.__init__
self.console = Console(highlight=False)
===========changed ref 0===========
# module: pywhat.printer
class Printing:
def pretty_print(self, text: dict, text_input):
to_out = ""
if text["File Signatures"] and text["Regexes"]:
for key, value in text["File Signatures"].items():
if value:
to_out += "\n"
to_out += f"[bold #D7Afff]File Identified[/bold #D7Afff]: [bold]{key}[/bold] with Magic Numbers {value['ISO 8859-1']}."
+ to_out += f"\n[bold #D7Afff]File Description: [/bold #D7Afff] {value['Description']}."
- to_out += f"\n[bold #D7Afff]File Description:[/bold #D7Afff] {value['Description']}."
+ to_out += "\n\n"
- to_out += "\n"
if text["Regexes"]:
+ to_out += "\n[bold #D7Afff]Possible Identification[/bold #D7Afff]\n"
- to_out += "\n[bold #D7Afff]Possible Identification[/bold #D7Afff]"
table = Table(
show_header=True, header_style="bold #D7Afff", show_lines=True
)
table.add_column("Matched Text", overflow="fold")
table.add_column("Identified as", overflow="fold")
table.add_column("Description", overflow="fold")
if self._check_if_directory(text_input):
# if input is a folder, add a filename column
table.add_column("File", overflow="fold")
# Check if there are any bug bounties with exploits
# in the regex
+ self._check_if_exploit_in_json(text)
- if self._check_if_exploit_in_json(text):
+ if self.bug_bounty_mode:
table.add_column("Exploit", overflow="fold")
</s>
===========changed ref 1===========
# module: pywhat.printer
class Printing:
def pretty_print(self, text: dict, text_input):
# offset: 1
<s> <add> if self.bug_bounty_mode:
table.add_column("Exploit", overflow="fold")
for key, value in text["Regexes"].items():
for i in value:
matched = i["Matched"]
name = i["Regex Pattern"]["Name"]
description = None
filename = key
+ exploit = None
if "URL" in i["Regex Pattern"] and i["Regex Pattern"]["URL"]:
description = (
"Click here to analyse in the browser\n"
+ i["Regex Pattern"]["URL"]
+ matched.replace(" ", "")
)
if i["Regex Pattern"]["Description"]:
if description:
description = (
description + "\n" + i["Regex Pattern"]["Description"]
)
else:
description = i["Regex Pattern"]["Description"]
if "Exploit" in i["Regex Pattern"] and i["Regex Pattern"]["Exploit"]:
exploit = i["Regex Pattern"]["Exploit"]
if not description:
description = "None"
#FIXME this is quite messy
if self.bug_bounty_mode:
if self._check_if_directory(text_input):
table.add_row(
matched,
name,
description,
filename,
exploit,
)
else:
table.add_row(
matched,
name,
description,
exploit,
)
else:
if self._check_if_directory(text_input):
table.add_row(
matched,
name,
description,
filename,
)
else:
table.add_row(
matched,
</s>
===========changed ref 2===========
# module: pywhat.printer
class Printing:
def pretty_print(self, text: dict, text_input):
# offset: 2
<s>
description,
)
self.console.print(to_out, table)
if to_out == "":
self.console.print("Nothing found!")
===========changed ref 3===========
# module: pywhat
+ __version__ = "4.0.0"
- __version__ = "3.4.1"
pywhat_tags = AvailableTags().get_tags()
__all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
|
pywhat.printer/Printing._check_if_exploit_in_json
|
Modified
|
bee-san~pyWhat
|
34e9790d056198c8a53ea2e16c91b490ed889966
|
Cleaned up the printing and tests pass
|
<0>:<add> if "File Signatures" in text.keys() and text["File Signatures"]:
<add> # loops files
<add> for file in text["Regexes"].keys():
<add> for i in text["Regexes"][file]:
<add> if "Exploit" in i.keys():
<add> self.bug_bounty_mode = True
<add> else:
<add> for value in text["Regexes"]["text"]:
<del> for value in text["Regexes"]["text"]:
<1>:<add> if "Exploit" in value["Regex Pattern"].keys():
<del> if "Exploit" in value["Regex Pattern"].keys():
<2>:<add> self.bug_bounty_mode = True
<del> self.bug_bounty_mode = True
|
# module: pywhat.printer
class Printing:
def _check_if_exploit_in_json(self, text: dict) -> bool:
<0> for value in text["Regexes"]["text"]:
<1> if "Exploit" in value["Regex Pattern"].keys():
<2> self.bug_bounty_mode = True
<3>
|
===========unchanged ref 0===========
at: pywhat.printer.Printing.__init__
self.console = Console(highlight=False)
at: pywhat.printer.Printing.print_raw
output_str += f"[bold #D7Afff]File: {key}[/bold #D7Afff]\n"
output_str += "\n\n"
output_str += "\n[bold #D7Afff]Name: [/bold #D7Afff]" + i["Regex Pattern"]["Name"]
output_str += f"\n[bold #D7Afff]File Description:[/bold #D7Afff] {value['Description']}."
output_str += "\n"
output_str += "[bold #D7Afff]Matched on: [/bold #D7Afff]" + i["Matched"]
output_str += "\n[bold #D7Afff]Exploit: [/bold #D7Afff]" + i["Regex Pattern"]["Exploit"]
output_str = ""
output_str += link
output_str += description
output_str += f"[bold #D7Afff]File Identified[/bold #D7Afff]: [bold]{key}[/bold] with Magic Numbers {value['ISO 8859-1']}."
===========changed ref 0===========
# module: pywhat.printer
class Printing:
def print_raw(self, text: dict, text_input) -> str:
output_str = ""
if text["File Signatures"] and text["Regexes"]:
for key, value in text["File Signatures"].items():
if value:
output_str += "\n"
output_str += f"[bold #D7Afff]File Identified[/bold #D7Afff]: [bold]{key}[/bold] with Magic Numbers {value['ISO 8859-1']}."
output_str += f"\n[bold #D7Afff]File Description:[/bold #D7Afff] {value['Description']}."
output_str += "\n"
if text["Regexes"]:
- output_str += "[bold #D7Afff]Possible Identification[/bold #D7Afff]\n"
-
for key, value in text["Regexes"].items():
for i in value:
description = None
matched = i["Matched"]
if self._check_if_directory(text_input):
+ output_str += f"[bold #D7Afff]File: {key}[/bold #D7Afff]\n"
- output_str += f"[bold]File: {key}[/bold]\n"
+ output_str += "[bold #D7Afff]Matched on: [/bold #D7Afff]" + i["Matched"]
- output_str += "[blue]Matched on: [/blue]" + i["Matched"]
+ output_str += "\n[bold #D7Afff]Name: [/bold #D7Afff]" + i["Regex Pattern"]["Name"]
- output_str += "\nName: " + i["Regex Pattern"]["Name"]
+ link = None
if "URL" in i["Regex Pattern"] and i["Regex Pattern"]["URL"]:
+ link = (
- description = (
+ "\n[bold #D7Afff]Link: [/bold #D7Afff] "
- </s>
===========changed ref 1===========
# module: pywhat.printer
class Printing:
def print_raw(self, text: dict, text_input) -> str:
# offset: 1
<s> = (
+ "\n[bold #D7Afff]Link: [/bold #D7Afff] "
- "\n[Blue]Description: [/Blue] Click here to analyse in the browser\n"
+ i["Regex Pattern"]["URL"]
+ matched.replace(" ", "")
)
+
+ if link:
+ output_str += link
if i["Regex Pattern"]["Description"]:
+ description = "\n[bold #D7Afff]Description: [/bold #D7Afff]" + i["Regex Pattern"]["Description"]
+
+ if description:
- if description:
+ output_str += description
- description = (
- description + "\n[Blue]Description: [/Blue] \n" + i["Regex Pattern"]["Description"]
- )
- else:
- description = "\n[Blue]Description: [/Blue]" + i["Regex Pattern"]["Description"]
if "Exploit" in i["Regex Pattern"] and i["Regex Pattern"]["Exploit"]:
+ output_str += "\n[bold #D7Afff]Exploit: [/bold #D7Afff]" + i["Regex Pattern"]["Exploit"]
- output_str += "\n[red]Exploit: [/red]" + i["Regex Pattern"]["Exploit"]
output_str += "\n\n"
if output_str == "":
self.console.print("Nothing found!")
self.console.print(output_str)
===========changed ref 2===========
# module: pywhat.printer
class Printing:
def pretty_print(self, text: dict, text_input):
to_out = ""
if text["File Signatures"] and text["Regexes"]:
for key, value in text["File Signatures"].items():
if value:
to_out += "\n"
to_out += f"[bold #D7Afff]File Identified[/bold #D7Afff]: [bold]{key}[/bold] with Magic Numbers {value['ISO 8859-1']}."
+ to_out += f"\n[bold #D7Afff]File Description: [/bold #D7Afff] {value['Description']}."
- to_out += f"\n[bold #D7Afff]File Description:[/bold #D7Afff] {value['Description']}."
+ to_out += "\n\n"
- to_out += "\n"
if text["Regexes"]:
+ to_out += "\n[bold #D7Afff]Possible Identification[/bold #D7Afff]\n"
- to_out += "\n[bold #D7Afff]Possible Identification[/bold #D7Afff]"
table = Table(
show_header=True, header_style="bold #D7Afff", show_lines=True
)
table.add_column("Matched Text", overflow="fold")
table.add_column("Identified as", overflow="fold")
table.add_column("Description", overflow="fold")
if self._check_if_directory(text_input):
# if input is a folder, add a filename column
table.add_column("File", overflow="fold")
# Check if there are any bug bounties with exploits
# in the regex
+ self._check_if_exploit_in_json(text)
- if self._check_if_exploit_in_json(text):
+ if self.bug_bounty_mode:
table.add_column("Exploit", overflow="fold")
</s>
|
pywhat.regex_identifier/RegexIdentifier.check
|
Modified
|
bee-san~pyWhat
|
1649f8441de06f7e366bebcce2d45fa7ac66769d
|
Merge branch 'main' into add-match-to-curl
|
<14>:<add>
<add> if reg.get("Exploit") is not None and "curl" in reg["Exploit"]:
<add> # Replace anything like XXXXX_XXXXXX_HERE with the match
<add> reg["Exploit"] = re.sub(r'[A-Z_]+_HERE', matched, reg["Exploit"])
|
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
<0> if dist is None:
<1> dist = self.distribution
<2> if boundaryless is None:
<3> boundaryless = Filter({"Tags": []})
<4> matches = []
<5>
<6> for string in text:
<7> for reg in dist.get_regexes():
<8> regex = (
<9> reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
<10> )
<11> for matched_regex in re.finditer(regex, string, re.MULTILINE):
<12> reg = copy.copy(reg)
<13> matched = self.clean_text(matched_regex.group(0))
<14>
<15> children = reg.get("Children")
<16> if children is not None:
<17> processed_match = re.sub(
<18> children.get("deletion_pattern", ""), "", matched
<19> )
<20> matched_children = []
<21> if children["method"] == "hashmap":
<22> for length in children["lengths"]:
<23> try:
<24> matched_children.append(
<25> children["Items"][processed_match[:length]]
<26> )
<27> except KeyError:
<28> continue
<29> else:
<30> for element in children["Items"]:
<31> if (
<32> children["method"] == "regex"
<33> and re.search(
<34> element, processed_match, re.MULTILINE
<35> )
<36> ) or (
<37> children["method"] == "startswith"
<38> and processed_match.startswith(element)
<39> ):
<40> matched_children.append(children["Items"][element])
<41>
<42> if matched_children:
<43> reg["Description"] = children.get("entry", "") + ", ".join(
<44> matched_children
<45> )
<46> reg.pop("Children", None)
<47>
<48> matches.</s>
|
===========below chunk 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========unchanged ref 0===========
at: copy
copy(x: _T) -> _T
at: pywhat.filter
Filter(filters_dict: Optional[Mapping]=None)
Distribution(filter: Optional[Filter]=None)
at: pywhat.filter.Distribution
get_regexes()
at: pywhat.regex_identifier.RegexIdentifier
clean_text(text)
at: pywhat.regex_identifier.RegexIdentifier.__init__
self.distribution = Distribution()
at: re
MULTILINE = RegexFlag.MULTILINE
search(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> Optional[Match[AnyStr]]
search(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> Optional[Match[AnyStr]]
sub(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int=..., flags: _FlagsType=...) -> AnyStr
sub(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int=..., flags: _FlagsType=...) -> AnyStr
sub(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int=..., flags: _FlagsType=...) -> AnyStr
sub(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int=..., flags: _FlagsType=...) -> AnyStr
finditer(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> Iterator[Match[AnyStr]]
finditer(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> Iterator[Match[AnyStr]]
at: typing.Match
pos: int
endpos: int
lastindex: Optional[int]
lastgroup: Optional[AnyStr]
string: AnyStr
re: Pattern[AnyStr]
===========unchanged ref 1===========
group(group1: Union[str, int], group2: Union[str, int], /, *groups: Union[str, int]) -> Tuple[AnyStr, ...]
group(group: Union[str, int]=..., /) -> AnyStr
|
tests.test_regex_identifier/test_slack_token
|
Modified
|
bee-san~pyWhat
|
1649f8441de06f7e366bebcce2d45fa7ac66769d
|
Merge branch 'main' into add-match-to-curl
|
<2>:<add> _assert_match_exploit_first_item("https://slack.com/api/auth.test?token=xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ", res)
|
# module: tests.test_regex_identifier
def test_slack_token():
<0> res = r.check(["xoxb-51465443183-hgvhXVd2ISC2x7gaoRWBOUdQ"])
<1> _assert_match_first_item("Slack Token", res)
<2>
|
===========unchanged ref 0===========
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: tests.test_regex_identifier
r = regex_identifier.RegexIdentifier()
_assert_match_first_item(name, res)
===========changed ref 0===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
if dist is None:
dist = self.distribution
if boundaryless is None:
boundaryless = Filter({"Tags": []})
matches = []
for string in text:
for reg in dist.get_regexes():
regex = (
reg["Boundaryless Regex"] if reg in boundaryless else reg["Regex"]
)
for matched_regex in re.finditer(regex, string, re.MULTILINE):
reg = copy.copy(reg)
matched = self.clean_text(matched_regex.group(0))
+
+ if reg.get("Exploit") is not None and "curl" in reg["Exploit"]:
+ # Replace anything like XXXXX_XXXXXX_HERE with the match
+ reg["Exploit"] = re.sub(r'[A-Z_]+_HERE', matched, reg["Exploit"])
children = reg.get("Children")
if children is not None:
processed_match = re.sub(
children.get("deletion_pattern", ""), "", matched
)
matched_children = []
if children["method"] == "hashmap":
for length in children["lengths"]:
try:
matched_children.append(
children["Items"][processed_match[:length]]
)
except KeyError:
continue
else:
for element in children["Items"]:
if (
children["method"] == "regex"
and re.search(
element, processed_match, re.MULTILINE
)
) or (
children["method"] == "startswith"
and processed_match.startswith(element)
):
matched_children.append(children["Items"][element])
if matched_children:
reg["Description"] = children.get("entry</s>
===========changed ref 1===========
# module: pywhat.regex_identifier
class RegexIdentifier:
def check(
self,
text,
dist: Optional[Distribution] = None,
*,
boundaryless: Optional[Filter] = None
):
# offset: 1
<s>.append(children["Items"][element])
if matched_children:
reg["Description"] = children.get("entry", "") + ", ".join(
matched_children
)
reg.pop("Children", None)
matches.append(
{
"Matched": matched,
"Regex Pattern": reg,
}
)
return matches
===========changed ref 2===========
# module: tests.test_regex_identifier
+ def _assert_match_exploit_first_item(search, res):
+ assert search in res[0]["Regex Pattern"]["Exploit"]
+
|
pywhat.identifier/Identifier.__init__
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<5>:<del> self._file_sig = FileSignatures()
|
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
<0> if dist is None:
<1> self.distribution = Distribution()
<2> else:
<3> self.distribution = dist
<4> self._regex_id = RegexIdentifier()
<5> self._file_sig = FileSignatures()
<6> self._key = key
<7> self._reverse = reverse
<8> if boundaryless is None:
<9> self.boundaryless = Filter({"Tags": []})
<10> else:
<11> self.boundaryless = boundaryless
<12>
|
===========unchanged ref 0===========
at: pywhat.filter
Filter(filters_dict: Optional[Mapping]=None)
Distribution(filter: Optional[Filter]=None)
at: pywhat.helper
Keys()
at: pywhat.regex_identifier
RegexIdentifier()
at: typing
Callable = _CallableType(collections.abc.Callable, 2)
|
pywhat.identifier/Identifier.identify
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<27>:<add> magic_numbers = pywhat.magic_numbers.get_magic_nums(string)
<add> with open(string, "r", encoding="utf-8", errors="ignore") as myfile:
<add> contents = [myfile.read()]
<del> magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
<28>:<del> contents = self._file_sig.open_file_loc(string)
<33>:<add> regex = self._regex_id.check(
<del> regex = self._regex_id.check(contents, dist
|
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
<0> if dist is None:
<1> dist = self.distribution
<2> if key is None:
<3> key = self._key
<4> if reverse is None:
<5> reverse = self._reverse
<6> if boundaryless is None:
<7> boundaryless = self.boundaryless
<8>
<9> identify_obj = {"File Signatures": {}, "Regexes": {}}
<10> search = []
<11>
<12> if not only_text and os.path.isdir(text):
<13> # if input is a directory, recursively search for all of the files
<14> for myfile in glob.iglob(text + "/**", recursive=True):
<15> if os.path.isfile(myfile):
<16> search.append(os.path.abspath(myfile))
<17> else:
<18> search = [text]
<19>
<20> for string in search:
<21> if not only_text and os.path.isfile(string):
<22> if os.path.isdir(text):
<23> short_name = string.replace(os.path.abspath(text), "")
<24> else:
<25> short_name = os.path.basename(string)
<26>
<27> magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
<28> contents = self._file_sig.open_file_loc(string)
<29>
<30> if include_filenames:
<31> contents.append(os.path.basename(string))
<32>
<33> regex = self._regex_id.check(contents, dist</s>
|
===========below chunk 0===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
if not magic_numbers:
magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=key, reverse=reverse
)
return identify_obj
===========unchanged ref 0===========
at: glob
iglob(pathname: AnyStr, *, recursive: bool=...) -> Iterator[AnyStr]
at: io.BufferedWriter
read(self, size: Optional[int]=..., /) -> bytes
at: os.path
isfile(path: AnyPath) -> bool
isdir(s: AnyPath) -> bool
basename(p: _PathLike[AnyStr]) -> AnyStr
basename(p: AnyStr) -> AnyStr
abspath(path: _PathLike[AnyStr]) -> AnyStr
abspath(path: AnyStr) -> AnyStr
abspath = _abspath_fallback
at: pywhat.filter
Filter(filters_dict: Optional[Mapping]=None)
Distribution(filter: Optional[Filter]=None)
at: pywhat.helper
Keys()
at: pywhat.identifier.Identifier.__init__
self.distribution = Distribution()
self.distribution = dist
self._regex_id = RegexIdentifier()
self._key = key
self._reverse = reverse
self.boundaryless = boundaryless
self.boundaryless = Filter({"Tags": []})
at: pywhat.regex_identifier.RegexIdentifier
check(text, dist: Optional[Distribution]=None, *, boundaryless: Optional[Filter]=None)
at: typing
Callable = _CallableType(collections.abc.Callable, 2)
at: typing.IO
__slots__ = ()
read(n: int=...) -> AnyStr
===========changed ref 0===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
|
tests.test_click/test_filtration
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<3>:<add> ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
<del> ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
|
# module: tests.test_click
def test_filtration():
<0> runner = CliRunner()
<1> result = runner.invoke(
<2> main,
<3> ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
<4> )
<5> assert result.exit_code == 0
<6> assert "THM{" not in result.output
<7> assert "ETH" not in result.output
<8> assert "Email Address" in result.output
<9> assert "IP" in result.output
<10> assert "URL" in result.output
<11>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: click.testing.Result.__init__
self.exit_code = exit_code
at: pywhat.what
main(**kwargs)
===========changed ref 0===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 1===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 2===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
===========changed ref 3===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
+ magic_numbers = pywhat.magic_numbers.get_magic_nums(string)
+ with open(string, "r", encoding="utf-8", errors="ignore") as myfile:
+ contents = [myfile.read()]
- magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
- contents = self._file_sig.open_file_loc(string)
if include_filenames:
</s>
===========changed ref 4===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s> contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
+ regex = self._regex_id.check(
- regex = self._regex_id.check(contents, dist)
+ contents, dist=dist, boundaryless=boundaryless
+ )
if not magic_numbers:
+ magic_numbers = pywhat.magic_numbers.check_magic_nums(string)
- magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=
|
tests.test_click/test_json_printing3
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
<del> result = runner.invoke(main, ["fixtures/file", "--json"])
|
# module: tests.test_click
def test_json_printing3():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file", "--json"])
<2> assert json.loads(result.output.replace("\n", ""))
<3>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: json
loads(s: Union[str, bytes], *, cls: Optional[Type[JSONDecoder]]=..., object_hook: Optional[Callable[[Dict[Any, Any]], Any]]=..., parse_float: Optional[Callable[[str], Any]]=..., parse_int: Optional[Callable[[str], Any]]=..., parse_constant: Optional[Callable[[str], Any]]=..., object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]]=..., **kwds: Any) -> Any
at: pywhat.what
main(**kwargs)
===========changed ref 0===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 1===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 2===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 3===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
===========changed ref 4===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
+ magic_numbers = pywhat.magic_numbers.get_magic_nums(string)
+ with open(string, "r", encoding="utf-8", errors="ignore") as myfile:
+ contents = [myfile.read()]
- magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
- contents = self._file_sig.open_file_loc(string)
if include_filenames:
</s>
===========changed ref 5===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s> contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
+ regex = self._regex_id.check(
- regex = self._regex_id.check(contents, dist)
+ contents, dist=dist, boundaryless=boundaryless
+ )
if not magic_numbers:
+ magic_numbers = pywhat.magic_numbers.check_magic_nums(string)
- magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=
|
tests.test_click/test_file_fixture
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("thm", str(result.output))
<4> assert re.findall("Ethereum", str(result.output))
<5> assert "Dogecoin" in result.output
<6>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: click.testing.Result.__init__
self.exit_code = exit_code
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 1===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 2===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 3===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 4===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
===========changed ref 5===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
+ magic_numbers = pywhat.magic_numbers.get_magic_nums(string)
+ with open(string, "r", encoding="utf-8", errors="ignore") as myfile:
+ contents = [myfile.read()]
- magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
- contents = self._file_sig.open_file_loc(string)
if include_filenames:
</s>
===========changed ref 6===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s> contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
+ regex = self._regex_id.check(
- regex = self._regex_id.check(contents, dist)
+ contents, dist=dist, boundaryless=boundaryless
+ )
if not magic_numbers:
+ magic_numbers = pywhat.magic_numbers.check_magic_nums(string)
- magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=
|
tests.test_click/test_file_fixture2
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture2():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert "Dogecoin" in result.output
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: click.testing.Result.__init__
self.exit_code = exit_code
at: pywhat.what
main(**kwargs)
===========changed ref 0===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 2===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 3===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 4===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 5===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
===========changed ref 6===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
+ magic_numbers = pywhat.magic_numbers.get_magic_nums(string)
+ with open(string, "r", encoding="utf-8", errors="ignore") as myfile:
+ contents = [myfile.read()]
- magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
- contents = self._file_sig.open_file_loc(string)
if include_filenames:
</s>
===========changed ref 7===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
# offset: 1
<s> contents = self._file_sig.open_file_loc(string)
if include_filenames:
contents.append(os.path.basename(string))
+ regex = self._regex_id.check(
- regex = self._regex_id.check(contents, dist)
+ contents, dist=dist, boundaryless=boundaryless
+ )
if not magic_numbers:
+ magic_numbers = pywhat.magic_numbers.check_magic_nums(string)
- magic_numbers = self._file_sig.check_magic_nums(string)
if magic_numbers:
identify_obj["File Signatures"][short_name] = magic_numbers
else:
short_name = "text"
regex = self._regex_id.check(
search, dist=dist, boundaryless=boundaryless
)
if regex:
identify_obj["Regexes"][short_name] = regex
for key_, value in identify_obj.items():
# if there are zero regex or file signature matches, set it to None
if len(identify_obj[key_]) == 0:
identify_obj[key_] = None
if key != Keys.NONE:
identify_obj["Regexes"][short_name] = sorted(
identify_obj["Regexes"][short_name], key=
|
tests.test_click/test_file_fixture3
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture3():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("thm", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: click.testing.Result.__init__
self.exit_code = exit_code
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 1===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 3===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 4===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 5===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 6===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
===========changed ref 7===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
+ magic_numbers = pywhat.magic_numbers.get_magic_nums(string)
+ with open(string, "r", encoding="utf-8", errors="ignore") as myfile:
+ contents = [myfile.read()]
- magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
- contents = self._file_sig.open_file_loc(string)
if include_filenames:
</s>
|
tests.test_click/test_file_fixture4
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture4():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Ethereum", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: click.testing.Result.__init__
self.exit_code = exit_code
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 2===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 4===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 5===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 6===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 7===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
===========changed ref 8===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
+ magic_numbers = pywhat.magic_numbers.get_magic_nums(string)
+ with open(string, "r", encoding="utf-8", errors="ignore") as myfile:
+ contents = [myfile.read()]
- magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
- contents = self._file_sig.open_file_loc(string)
if include_filenames:
</s>
|
tests.test_click/test_file_fixture5
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture5():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("thm{", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 3===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 5===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 6===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 7===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 8===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
===========changed ref 9===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
+ magic_numbers = pywhat.magic_numbers.get_magic_nums(string)
+ with open(string, "r", encoding="utf-8", errors="ignore") as myfile:
+ contents = [myfile.read()]
- magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
- contents = self._file_sig.open_file_loc(string)
if include_filenames:
</s>
|
tests.test_click/test_file_fixture7
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture7():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall('thm{"', str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 4===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 6===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 7===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 8===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 9===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
===========changed ref 10===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
+ magic_numbers = pywhat.magic_numbers.get_magic_nums(string)
+ with open(string, "r", encoding="utf-8", errors="ignore") as myfile:
+ contents = [myfile.read()]
- magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
- contents = self._file_sig.open_file_loc(string)
if include_filenames:
</s>
|
tests.test_click/test_file_fixture8
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture8():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("URL", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 5===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 7===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 8===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 9===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 10===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
===========changed ref 11===========
# module: pywhat.identifier
class Identifier:
def identify(
self,
text: str,
*,
only_text=True,
dist: Distribution = None,
key: Optional[Callable] = None,
reverse: Optional[bool] = None,
boundaryless: Optional[Filter] = None,
include_filenames=False,
) -> dict:
if dist is None:
dist = self.distribution
if key is None:
key = self._key
if reverse is None:
reverse = self._reverse
if boundaryless is None:
boundaryless = self.boundaryless
identify_obj = {"File Signatures": {}, "Regexes": {}}
search = []
if not only_text and os.path.isdir(text):
# if input is a directory, recursively search for all of the files
for myfile in glob.iglob(text + "/**", recursive=True):
if os.path.isfile(myfile):
search.append(os.path.abspath(myfile))
else:
search = [text]
for string in search:
if not only_text and os.path.isfile(string):
if os.path.isdir(text):
short_name = string.replace(os.path.abspath(text), "")
else:
short_name = os.path.basename(string)
+ magic_numbers = pywhat.magic_numbers.get_magic_nums(string)
+ with open(string, "r", encoding="utf-8", errors="ignore") as myfile:
+ contents = [myfile.read()]
- magic_numbers = self._file_sig.open_binary_scan_magic_nums(string)
- contents = self._file_sig.open_file_loc(string)
if include_filenames:
</s>
|
tests.test_click/test_file_fixture9
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture9():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("etherscan", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 6===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 8===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 9===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 10===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 11===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
|
tests.test_click/test_file_fixture10
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture10():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("dogechain", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 7===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 9===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 10===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 11===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 12===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
|
tests.test_click/test_file_fixture11
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture11():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Dogecoin", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 8===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 10===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 11===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 12===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 13===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
|
tests.test_click/test_file_fixture12
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture12():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Ethereum", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 9===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 11===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 12===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 13===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 14===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
|
tests.test_click/test_file_fixture13
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture13():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Bitcoin", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 10===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 12===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 13===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 14===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
===========changed ref 15===========
# module: pywhat.identifier
class Identifier:
def __init__(
self,
*,
dist: Optional[Distribution] = None,
key: Callable = Keys.NONE,
reverse=False,
boundaryless: Optional[Filter] = None,
):
if dist is None:
self.distribution = Distribution()
else:
self.distribution = dist
self._regex_id = RegexIdentifier()
- self._file_sig = FileSignatures()
self._key = key
self._reverse = reverse
if boundaryless is None:
self.boundaryless = Filter({"Tags": []})
else:
self.boundaryless = boundaryless
|
tests.test_click/test_file_fixture_visa
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_visa():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Visa", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 11===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 13===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 14===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 15===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
|
tests.test_click/test_file_fixture_master_card
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_master_card():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("MasterCard", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 12===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 14===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 15===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
===========changed ref 16===========
# module: pywhat
__version__ = "4.0.0"
+ tags = AvailableTags().get_tags()
- pywhat_tags = AvailableTags().get_tags()
+ pywhat_tags = tags # left for backward compatibility purposes
+
+ _contents = ["Identifier", "Distribution", "tags", "pywhat_tags", "Keys", "Filter"]
+ __all__ = _contents
- __all__ = ["Identifier", "Distribution", "pywhat_tags", "Keys", "Filter"]
|
tests.test_click/test_file_fixture_master_amex
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_master_amex():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("American Express", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 13===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
===========changed ref 15===========
# module: tests.test_click
def test_filtration():
runner = CliRunner()
result = runner.invoke(
main,
+ ["--rarity", "0.5:", "--include", "Identifiers,Media", "-db", "fixtures/file"],
- ["--rarity", "0.5:", "--include", "Identifiers,Media", "fixtures/file"],
)
assert result.exit_code == 0
assert "THM{" not in result.output
assert "ETH" not in result.output
assert "Email Address" in result.output
assert "IP" in result.output
assert "URL" in result.output
===========changed ref 16===========
# module: pywhat
+ def __dir__():
+ return _contents + ["__version__"]
+
|
tests.test_click/test_file_fixture_master_diners
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_master_diners():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Diners Club Card", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 14===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
|
tests.test_click/test_file_fixture_discover
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_discover():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Discover", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
===========changed ref 15===========
# module: tests.test_click
def test_json_printing3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file", "--json"])
- result = runner.invoke(main, ["fixtures/file", "--json"])
assert json.loads(result.output.replace("\n", ""))
===========changed ref 16===========
# module: tests.test_click
def test_file_fixture():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
assert re.findall("Ethereum", str(result.output))
assert "Dogecoin" in result.output
|
tests.test_click/test_file_fixture_usernamepassword
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Key", str(result.output))
<4>
|
===========unchanged ref 0===========
at: _pytest.mark.structures
MARK_GEN = MarkGenerator(_ispytest=True)
at: _pytest.mark.structures.MarkGenerator
skip: _SkipMarkDecorator
skipif: _SkipifMarkDecorator
xfail: _XfailMarkDecorator
parametrize: _ParametrizeMarkDecorator
usefixtures: _UsefixturesMarkDecorator
filterwarnings: _FilterwarningsMarkDecorator
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
|
tests.test_click/test_file_fixture_email
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_email():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Email", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
===========changed ref 16===========
# module: tests.test_click
def test_file_fixture2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert "Dogecoin" in result.output
|
tests.test_click/test_file_fixture_youtube
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_youtube():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("YouTube", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 1===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 16===========
# module: tests.test_click
def test_file_fixture3():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm", str(result.output))
|
tests.test_click/test_file_fixture_youtube_id
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_youtube_id():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("YouTube", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 2===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
===========changed ref 16===========
# module: tests.test_click
def test_file_fixture4():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
|
tests.test_click/test_file_fixture_ssn
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_ssn():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Social", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 3===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture7():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall('thm{"', str(result.output))
===========changed ref 16===========
# module: tests.test_click
def test_file_fixture5():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("thm{", str(result.output))
|
tests.test_click/test_file_pcap
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/FollowTheLeader.pcap"])
<del> result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
|
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_pcap():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
<2> assert result.exit_code == 0
<3> assert re.findall("Host:", str(result.output))
<4>
|
===========unchanged ref 0===========
at: _pytest.mark.structures
MARK_GEN = MarkGenerator(_ispytest=True)
at: _pytest.mark.structures.MarkGenerator
skip: _SkipMarkDecorator
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_ssn():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Social", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 4===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture8():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("URL", str(result.output))
|
tests.test_click/test_file_fixture_ltc
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_ltc():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Litecoin", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_ssn():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Social", str(result.output))
===========changed ref 1===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_pcap():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/FollowTheLeader.pcap"])
- result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
assert result.exit_code == 0
assert re.findall("Host:", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 5===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture9():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("etherscan", str(result.output))
|
tests.test_click/test_file_fixture_ltc2
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_ltc2():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("live.block", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_ltc():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Litecoin", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_ssn():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Social", str(result.output))
===========changed ref 2===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_pcap():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/FollowTheLeader.pcap"])
- result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
assert result.exit_code == 0
assert re.findall("Host:", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 6===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture10():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("dogechain", str(result.output))
|
tests.test_click/test_file_fixture_bch
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_bch():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Bitcoin Cash", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_ltc2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("live.block", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_ltc():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Litecoin", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_ssn():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Social", str(result.output))
===========changed ref 3===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_pcap():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/FollowTheLeader.pcap"])
- result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
assert result.exit_code == 0
assert re.findall("Host:", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 7===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture11():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Dogecoin", str(result.output))
|
tests.test_click/test_file_fixture_xrp
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_xrp():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Ripple", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_bch():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin Cash", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_ltc2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("live.block", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_ltc():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Litecoin", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_ssn():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Social", str(result.output))
===========changed ref 4===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_pcap():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/FollowTheLeader.pcap"])
- result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
assert result.exit_code == 0
assert re.findall("Host:", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 8===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture12():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ethereum", str(result.output))
|
tests.test_click/test_file_fixture_xrp2
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_xrp2():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("xrpscan", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_xrp():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ripple", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_bch():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin Cash", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_ltc2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("live.block", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_ltc():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Litecoin", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_ssn():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Social", str(result.output))
===========changed ref 5===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_pcap():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/FollowTheLeader.pcap"])
- result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
assert result.exit_code == 0
assert re.findall("Host:", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 9===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture13():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin", str(result.output))
|
tests.test_click/test_file_fixture_xmr
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_file_fixture_xmr():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("Monero", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_xrp2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("xrpscan", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_xrp():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ripple", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_bch():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin Cash", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_ltc2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("live.block", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_ltc():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Litecoin", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_ssn():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Social", str(result.output))
===========changed ref 6===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_pcap():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/FollowTheLeader.pcap"])
- result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
assert result.exit_code == 0
assert re.findall("Host:", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 10===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
|
tests.test_click/test_only_text
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-o", "-db", "fixtures/file"])
<del> result = runner.invoke(main, ["-o", "fixtures/file"])
|
# module: tests.test_click
def test_only_text():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["-o", "fixtures/file"])
<2> assert result.exit_code == 0
<3> assert "Nothing found" in result.output
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
===========changed ref 0===========
# module: tests.test_click
def test_file_fixture_xmr():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Monero", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_xrp2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("xrpscan", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_xrp():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ripple", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_bch():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin Cash", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_ltc2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("live.block", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_ltc():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Litecoin", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_ssn():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Social", str(result.output))
===========changed ref 7===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_pcap():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/FollowTheLeader.pcap"])
- result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
assert result.exit_code == 0
assert re.findall("Host:", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 11===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture_master_card():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("MasterCard", str(result.output))
===========changed ref 16===========
# module: tests.test_click
def test_file_fixture_visa():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Visa", str(result.output))
|
tests.test_click/test_ssh_rsa_key
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_ssh_rsa_key():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("SSH RSA", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_only_text():
runner = CliRunner()
+ result = runner.invoke(main, ["-o", "-db", "fixtures/file"])
- result = runner.invoke(main, ["-o", "fixtures/file"])
assert result.exit_code == 0
assert "Nothing found" in result.output
===========changed ref 1===========
# module: tests.test_click
def test_file_fixture_xmr():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Monero", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_xrp2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("xrpscan", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_xrp():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ripple", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_bch():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin Cash", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_ltc2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("live.block", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_ltc():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Litecoin", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture_ssn():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Social", str(result.output))
===========changed ref 8===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_pcap():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/FollowTheLeader.pcap"])
- result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
assert result.exit_code == 0
assert re.findall("Host:", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 12===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture_master_amex():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("American Express", str(result.output))
|
tests.test_click/test_ssh_ecdsa_key
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_ssh_ecdsa_key():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("SSH ECDSA", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_ssh_rsa_key():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("SSH RSA", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_only_text():
runner = CliRunner()
+ result = runner.invoke(main, ["-o", "-db", "fixtures/file"])
- result = runner.invoke(main, ["-o", "fixtures/file"])
assert result.exit_code == 0
assert "Nothing found" in result.output
===========changed ref 2===========
# module: tests.test_click
def test_file_fixture_xmr():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Monero", str(result.output))
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_xrp2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("xrpscan", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_xrp():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ripple", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_bch():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin Cash", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_ltc2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("live.block", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture_ltc():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Litecoin", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture_ssn():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Social", str(result.output))
===========changed ref 9===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_pcap():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/FollowTheLeader.pcap"])
- result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
assert result.exit_code == 0
assert re.findall("Host:", str(result.output))
===========changed ref 10===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 13===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 14===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture_master_diners():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Diners Club Card", str(result.output))
|
tests.test_click/test_ssh_ed25519_key
|
Modified
|
bee-san~pyWhat
|
a40757bcb0b372b144e29f424e7eb07023897cc9
|
Merge branch 'main' into bug-fixes-cleanup
|
<1>:<add> result = runner.invoke(main, ["-db", "fixtures/file"])
<del> result = runner.invoke(main, ["fixtures/file"])
|
# module: tests.test_click
def test_ssh_ed25519_key():
<0> runner = CliRunner()
<1> result = runner.invoke(main, ["fixtures/file"])
<2> assert result.exit_code == 0
<3> assert re.findall("SSH ED25519", str(result.output))
<4>
|
===========unchanged ref 0===========
at: click.testing
CliRunner(charset: Optional[Text]=..., env: Optional[Mapping[str, str]]=..., echo_stdin: bool=..., mix_stderr: bool=...)
at: click.testing.CliRunner
invoke(cli: BaseCommand, args: Optional[Union[str, Iterable[str]]]=..., input: Optional[Union[bytes, Text, IO[Any]]]=..., env: Optional[Mapping[str, str]]=..., catch_exceptions: bool=..., color: bool=..., **extra: Any) -> Result
at: pywhat.what
main(**kwargs)
at: re
findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType=...) -> List[Any]
findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> List[Any]
===========changed ref 0===========
# module: tests.test_click
def test_ssh_ecdsa_key():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("SSH ECDSA", str(result.output))
===========changed ref 1===========
# module: tests.test_click
def test_ssh_rsa_key():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("SSH RSA", str(result.output))
===========changed ref 2===========
# module: tests.test_click
def test_only_text():
runner = CliRunner()
+ result = runner.invoke(main, ["-o", "-db", "fixtures/file"])
- result = runner.invoke(main, ["-o", "fixtures/file"])
assert result.exit_code == 0
assert "Nothing found" in result.output
===========changed ref 3===========
# module: tests.test_click
def test_file_fixture_xmr():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Monero", str(result.output))
===========changed ref 4===========
# module: tests.test_click
def test_file_fixture_xrp2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("xrpscan", str(result.output))
===========changed ref 5===========
# module: tests.test_click
def test_file_fixture_xrp():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Ripple", str(result.output))
===========changed ref 6===========
# module: tests.test_click
def test_file_fixture_bch():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Bitcoin Cash", str(result.output))
===========changed ref 7===========
# module: tests.test_click
def test_file_fixture_ltc2():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("live.block", str(result.output))
===========changed ref 8===========
# module: tests.test_click
def test_file_fixture_ltc():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Litecoin", str(result.output))
===========changed ref 9===========
# module: tests.test_click
def test_file_fixture_ssn():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Social", str(result.output))
===========changed ref 10===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_pcap():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/FollowTheLeader.pcap"])
- result = runner.invoke(main, ["fixtures/FollowTheLeader.pcap"])
assert result.exit_code == 0
assert re.findall("Host:", str(result.output))
===========changed ref 11===========
# module: tests.test_click
def test_file_fixture_youtube_id():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 12===========
# module: tests.test_click
def test_file_fixture_youtube():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("YouTube", str(result.output))
===========changed ref 13===========
# module: tests.test_click
def test_file_fixture_email():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Email", str(result.output))
===========changed ref 14===========
# module: tests.test_click
@pytest.mark.skip("Key:value turned off")
def test_file_fixture_usernamepassword():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Key", str(result.output))
===========changed ref 15===========
# module: tests.test_click
def test_file_fixture_discover():
runner = CliRunner()
+ result = runner.invoke(main, ["-db", "fixtures/file"])
- result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Discover", str(result.output))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.