Skip to content

Commit 8b2a4e7

Browse files
committed
Set some regex to 0
Too spammy, I set them to 0.1 earlier but I was meant to set to 0!
1 parent e36b83a commit 8b2a4e7

File tree

5 files changed

+28
-25
lines changed

5 files changed

+28
-25
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pywhat"
3-
version = "4.3.0"
3+
version = "4.3.1"
44
description = "What is that thing?"
55
authors = ["Bee <[email protected]>"]
66
license = "MIT"

pywhat/Data/regex.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@
17631763
"Regex": "^([0-9a-fA-F]{24})$",
17641764
"plural_name": false,
17651765
"Description": null,
1766-
"Rarity": 0.1,
1766+
"Rarity": 0,
17671767
"URL": null,
17681768
"Tags": [
17691769
"Identifiers",
@@ -1776,7 +1776,7 @@
17761776
"Regex": "^([0-9]{10})$",
17771777
"plural_name": false,
17781778
"Description": "Seconds elapsed since unix epoch: 1970, between year 2001 and 2286",
1779-
"Rarity": 0.1,
1779+
"Rarity": 0,
17801780
"URL": null,
17811781
"Tags": [
17821782
"UNIX Timestamp",
@@ -1789,7 +1789,7 @@
17891789
"Regex": "^([0-9]{13})$",
17901790
"plural_name": false,
17911791
"Description": "Milliseconds elapsed since unix epoch: 1970, between year 2001 and 2286",
1792-
"Rarity": 0.1,
1792+
"Rarity": 0,
17931793
"URL": null,
17941794
"Tags": [
17951795
"UNIX Timestamp",
@@ -1802,7 +1802,7 @@
18021802
"Regex": "^([0-9]{8,10})$",
18031803
"plural_name": false,
18041804
"Description": "Seconds elapsed since unix epoch: 1970",
1805-
"Rarity": 0.1,
1805+
"Rarity": 0,
18061806
"URL": null,
18071807
"Tags": [
18081808
"UNIX Timestamp",
@@ -1815,7 +1815,7 @@
18151815
"Regex": "^([0-9]{11,13})$",
18161816
"plural_name": false,
18171817
"Description": "Milliseconds elapsed since unix epoch: 1970",
1818-
"Rarity": 0.1,
1818+
"Rarity": 0,
18191819
"URL": null,
18201820
"Tags": [
18211821
"UNIX Timestamp",
@@ -1828,7 +1828,7 @@
18281828
"Regex": "^([0-9A-HJKMNP-TV-Z]{26})$",
18291829
"plural_name": false,
18301830
"Description": null,
1831-
"Rarity": 0.1,
1831+
"Rarity": 0,
18321832
"URL": null,
18331833
"Tags": [
18341834
"Identifiers",
@@ -1840,7 +1840,7 @@
18401840
"Regex": "^((?=.*[A-Z])(?=.*[a-z])[0-9A-Za-z_-]{10}[048AEIMQUYcgkosw]{1})$",
18411841
"plural_name": false,
18421842
"Description": null,
1843-
"Rarity": 0.1,
1843+
"Rarity": 0,
18441844
"URL": "https://www.youtube.com/watch?v=",
18451845
"Tags": [
18461846
"Media",
@@ -1853,7 +1853,7 @@
18531853
"Regex": "^([0-9]{10})$",
18541854
"plural_name": false,
18551855
"Description": null,
1856-
"Rarity": 0.1,
1856+
"Rarity": 0,
18571857
"URL": null,
18581858
"Tags": [
18591859
"Credentials",

pywhat/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pywhat.helper import AvailableTags, Keys
33
from pywhat.identifier import Identifier
44

5-
__version__ = "4.3.0"
5+
__version__ = "4.3.1"
66

77
tags = AvailableTags().get_tags()
88
pywhat_tags = tags # left for backward compatibility purposes

tests/test_click.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ def test_pgp_private_key():
573573

574574
def test_file_fixture_turkish_car_plate():
575575
runner = CliRunner()
576-
result = runner.invoke(main, ["fixtures/file"])
576+
result = runner.invoke(main, ["--rarity", "0:", "fixtures/file"])
577577
assert result.exit_code == 0
578578
assert re.findall("Turkish License Plate Number", str(result.output))
579579

@@ -594,7 +594,7 @@ def test_file_fixture_turkish_id_number():
594594

595595
def test_file_fixture_turkish_tax_number():
596596
runner = CliRunner()
597-
result = runner.invoke(main, ["fixtures/file"])
597+
result = runner.invoke(main, ["--rarity", "0:", "fixtures/file"])
598598
assert result.exit_code == 0
599599
assert re.findall("Turkish Tax Number", str(result.output))
600600

@@ -608,14 +608,14 @@ def test_file_fixture_uuid():
608608

609609
def test_file_fixture_objectid():
610610
runner = CliRunner()
611-
result = runner.invoke(main, ["fixtures/file"])
611+
result = runner.invoke(main, ["--rarity", "0:", "fixtures/file"])
612612
assert result.exit_code == 0
613613
assert re.findall("ObjectID", str(result.output))
614614

615615

616616
def test_file_fixture_ulid():
617617
runner = CliRunner()
618-
result = runner.invoke(main, ["fixtures/file"])
618+
result = runner.invoke(main, ["--rarity", "0:", "fixtures/file"])
619619
assert result.exit_code == 0
620620
assert re.findall("ULID", str(result.output))
621621

tests/test_regex_identifier.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
import pytest
44

55
from pywhat import regex_identifier
6-
from pywhat.filter import Filter
6+
from pywhat.filter import Distribution, Filter
77
from pywhat.helper import load_regexes
88

99
database = load_regexes()
1010
r = regex_identifier.RegexIdentifier()
11+
filter1 = Filter({"MinRarity": 0.0})
12+
d = Distribution(filter1)
13+
r_rarity_0 = regex_identifier.RegexIdentifier()
1114

1215

1316
def _assert_match_first_item(name, res):
@@ -415,12 +418,12 @@ def test_youtube2():
415418

416419

417420
def test_youtube_id():
418-
res = r.check(["dQw4w9WgXcQ"])
421+
res = r.check(["dQw4w9WgXcQ"], dist=d)
419422
_assert_match_first_item("YouTube Video ID", res)
420423

421424

422425
def test_youtube_id2():
423-
res = r.check(["078-05-1120"])
426+
res = r.check(["078-05-1120"], dist=d)
424427
assert "YouTube Video ID" not in res
425428

426429

@@ -533,35 +536,35 @@ def test_arn4():
533536

534537

535538
def test_unix_timestamp():
536-
res = r.check(["1577836800"]) # 2020-01-01
539+
res = r.check(["1577836800"], dist=d) # 2020-01-01
537540
keys = [m["Regex Pattern"]["Name"] for m in res]
538541
assert "Unix Timestamp" in keys
539542
assert "Recent Unix Timestamp" in keys
540543

541544

542545
def test_unix_timestamp2():
543-
res = r.check(["94694400"]) # 1973-01-01
546+
res = r.check(["94694400"], dist=d) # 1973-01-01
544547
keys = [m["Regex Pattern"]["Name"] for m in res]
545548
assert "Unix Timestamp" in keys
546549
assert "Recent Unix Timestamp" not in keys
547550

548551

549552
def test_unix_timestamp3():
550-
res = r.check(["1234567"]) # 7 numbers
553+
res = r.check(["1234567"], dist=d) # 7 numbers
551554
keys = [m["Regex Pattern"]["Name"] for m in res]
552555
assert "Unix Timestamp" not in keys
553556
assert "Recent Unix Timestamp" not in keys
554557

555558

556559
def test_unix_timestamp4():
557-
res = r.check(["1577836800000"]) # 2020-01-01
560+
res = r.check(["1577836800000"], dist=d) # 2020-01-01
558561
keys = [m["Regex Pattern"]["Name"] for m in res]
559562
assert "Unix Millisecond Timestamp" in keys
560563
assert "Recent Unix Millisecond Timestamp" in keys
561564

562565

563566
def test_unix_timestamp5():
564-
res = r.check(["94694400000"]) # 1973-01-01
567+
res = r.check(["94694400000"], dist=d) # 1973-01-01
565568
keys = [m["Regex Pattern"]["Name"] for m in res]
566569
assert "Unix Millisecond Timestamp" in keys
567570
assert "Recent Unix Millisecond Timestamp" not in keys
@@ -1006,7 +1009,7 @@ def test_turkish_id_number2():
10061009

10071010

10081011
def test_turkish_tax_number():
1009-
res = r.check(["1234567890"])
1012+
res = r.check(["1234567890"], dist=d)
10101013
assert "Turkish Tax Number" in str(res)
10111014

10121015

@@ -1016,12 +1019,12 @@ def test_uuid():
10161019

10171020

10181021
def test_objectid():
1019-
res = r.check(["5fc7c33a7ef88b139122a38a"])
1022+
res = r_rarity_0.check(["5fc7c33a7ef88b139122a38a"], dist=d)
10201023
assert "ObjectID" in str(res)
10211024

10221025

10231026
def test_ulid():
1024-
res = r.check(["01ERJ58HMWDN3VTRRHZQV2T5R5"])
1027+
res = r_rarity_0.check(["01ERJ58HMWDN3VTRRHZQV2T5R5"], dist=d)
10251028
assert "ULID" in str(res)
10261029

10271030

0 commit comments

Comments
 (0)