Skip to content

Commit

Permalink
Lock yara-python at 4.2.3 bc 4.3.x causes problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ashariyar committed May 1, 2023
1 parent 27bef7c commit acd2e77
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 128 deletions.
212 changes: 89 additions & 123 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 @@ -44,7 +44,7 @@ chardet = "^5.0.0"
python-dotenv = "^0.21.0"
rich = "^12.5.1"
rich-argparse-plus = "^0.3.1"
yara-python = "^4.2.3"
yara-python = "~4.2.3"

[tool.poetry.group.dev.dependencies]
pytest = "^7.1.3"
Expand Down
8 changes: 4 additions & 4 deletions tests/test_yaralyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
def test_help_option():
help_text = _run_with_args('-h')
assert 'maximize-width' in help_text
_assert_line_count_within_range(127, help_text)
_assert_line_count_within_range(116, help_text)


def test_no_rule_args(il_tulipano_path):
Expand All @@ -46,13 +46,13 @@ def test_yaralyze_with_files(il_tulipano_path, tulips_yara_path):
yaralyze -Y tests/file_fixtures/tulips.yara tests/file_fixtures/il_tulipano_nero.txt
yaralyze -dir tests/file_fixtures/ tests/file_fixtures/il_tulipano_nero.txt
"""
test_line_count = partial(_assert_output_line_count_is_close, 1002, il_tulipano_path)
test_line_count = partial(_assert_output_line_count_is_close, 948, il_tulipano_path)
test_line_count('-Y', tulips_yara_path)
test_line_count('-dir', path.dirname(tulips_yara_path))


def test_yaralyze_with_patterns(il_tulipano_path, binary_file_path, tulips_yara_regex):
_assert_output_line_count_is_close(999, il_tulipano_path, '-re', tulips_yara_regex)
_assert_output_line_count_is_close(945, il_tulipano_path, '-re', tulips_yara_regex)
_assert_output_line_count_is_close(90, binary_file_path, '-re', '3Hl0')
_assert_output_line_count_is_close(96, binary_file_path, '-hex', HEX_STRING)

Expand All @@ -62,7 +62,7 @@ def test_file_export(binary_file_path, tulips_yara_path, tmp_dir):
rendered_files = files_in_dir(tmp_dir)
assert len(rendered_files) == 3
file_sizes = [path.getsize(f) for f in rendered_files]
_assert_array_is_close(sorted(file_sizes), [62223, 106947, 307839])
_assert_array_is_close(sorted(file_sizes), [41677, 71115, 220090])

for file in rendered_files:
remove(file)
Expand Down

0 comments on commit acd2e77

Please sign in to comment.