Skip to content

Commit

Permalink
chore(deps): update dependency black to v23 (#441)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency black to v23

* Reformat to black 2023 standard

Eliminate blank lines at head of code blocks; this will be accepted by
older standards and is mandatory for the (new) current standard.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Scott Bailey <[email protected]>
  • Loading branch information
renovate[bot] and rscottbailey authored Mar 1, 2023
1 parent 4ec804e commit fa09773
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 23 deletions.
44 changes: 29 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ tomlkit = "^0.11.4"
cached-property = "^1.5.2"

[tool.poetry.group.dev.dependencies]
black = "^22.3.0"
black = "^23.0.0"
coverage = {extras = ["toml"], version = "^7.0"}
mypy = {version = "^1.0", markers = "platform_python_implementation == 'CPython'"}
pre-commit = "*"
Expand Down
3 changes: 0 additions & 3 deletions tests/test_base_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,13 +651,11 @@ def test_sensitivity_high_end_calculation(self):
self.assertEqual(test_scanner.hex_entropy_limit, 4.0)

def test_calculate_entropy_minimum_calculation(self):

# We already know an empty string trivially has zero entropy.
# Doing the math, a one-character string also should have zero entropy.
self.assertEqual(self.scanner.calculate_entropy("a"), 0.0)

def test_calculate_entropy_maximum_hexadecimal(self):

# We reach maximum entropy when every character in the alphabet appears
# once in the input string (order doesn't matter). Each character represents
# 4 bits (has 2^4 = 16 possible values).
Expand All @@ -673,7 +671,6 @@ def test_calculate_entropy_maximum_hexadecimal(self):
self.assertEqual(self.scanner.calculate_entropy(alphabet), 4.0)

def test_calculate_entropy_maximum_base64(self):

# See above. base64 uses 4 characters to represent 3 bytes, so the
# underlying bit rate is 24 / 4 = 6 bits per character. Unlike above,
# case matters, so we include both upper- and lowercase letters.
Expand Down
4 changes: 0 additions & 4 deletions tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,6 @@ def test_find_strings_by_regex_will_not_return_strings_below_threshold_length(se
self.assertEqual(strings, ["asdf"])

def test_find_strings_by_regex_recognizes_hexadecimal(self):

sample_input = """
1111111111fffffCCCCC This is valid hexadecimal
g111111111fffffCCCCC This is not because "g" is not in alphabet
Expand All @@ -719,7 +718,6 @@ def test_find_strings_by_regex_recognizes_hexadecimal(self):
self.assertEqual(strings, ["1111111111fffffCCCCC"])

def test_find_strings_by_regex_recognizes_base64(self):

sample_input = """
111111111+ffffCCCC== This is valid base64
@111111111+ffffCCCC= This is not because "@" is not in alphabet
Expand All @@ -731,7 +729,6 @@ def test_find_strings_by_regex_recognizes_base64(self):
self.assertEqual(strings, ["111111111+ffffCCCC=="])

def test_find_strings_by_regex_recognizes_base64url(self):

sample_input = """
111111111-ffffCCCC== This is valid base64url
@111111111-ffffCCCC= This is not because "@" is not in alphabet
Expand All @@ -743,7 +740,6 @@ def test_find_strings_by_regex_recognizes_base64url(self):
self.assertEqual(strings, ["111111111-ffffCCCC=="])

def test_find_strings_by_regex_recognizes_mutant_base64(self):

sample_input = """
+111111111-ffffCCCC= Can't mix + and - but both are in regex
111111111111111111111== Not a valid length but we don't care
Expand Down

0 comments on commit fa09773

Please sign in to comment.