Skip to content

Commit

Permalink
Merge pull request #39 from frack113/0.7.11
Browse files Browse the repository at this point in the history
Update poetry to 0.7.11
  • Loading branch information
thomaspatzke authored Dec 9, 2023
2 parents 877aad4 + aa52ed8 commit cd5e47e
Show file tree
Hide file tree
Showing 6 changed files with 600 additions and 601 deletions.
1,180 changes: 588 additions & 592 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sigma-cli"
version = "0.7.10"
version = "0.7.11"
description = "Sigma Command Line Interface (conversion, check etc.) based on pySigma"
authors = ["Thomas Patzke <thomas@patzke.org>"]
license = "LGPL-2.1-or-later"
Expand Down
1 change: 0 additions & 1 deletion sigma/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
pass

import importlib.metadata as metadata
import click
from .list import list_group
from .convert import convert
from .check import check
Expand Down
2 changes: 2 additions & 0 deletions tests/files/valid/sigma_rule.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
title: Test rule
id: 5013332f-8a70-4e04-bcc1-06a98a2cca2e
description: it is a valid rule
status: stable
level: high
date: 2023-12-09
logsource:
category: process_creation
product: windows
Expand Down
13 changes: 7 additions & 6 deletions tests/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def test_check_valid():

def test_check_stdin():
cli = CliRunner()
input = open("tests/files/valid/sigma_rule.yml", "rt").read()
with open("tests/files/valid/sigma_rule.yml", "rt") as yml_file:
input = yml_file.read()
result = cli.invoke(check, ["-"], input=input)
assert result.exit_code == 0
assert "0 errors" in result.stdout
Expand All @@ -41,8 +42,8 @@ def test_check_invalid():
def test_check_with_issues():
cli = CliRunner()
result = cli.invoke(check, ["tests/files/issues"])
assert result.exit_code == 0
assert "11 issues" in result.stdout
assert result.exit_code == 1
assert "12 issues" in result.stdout


def test_check_with_issues_exclusions():
Expand All @@ -55,8 +56,8 @@ def test_check_with_issues_exclusions():
"tests/files/issues",
],
)
assert result.exit_code == 0
assert "9 issues" in result.stdout
assert result.exit_code == 1
assert "10 issues" in result.stdout


def test_check_fail_on_issues():
Expand All @@ -83,7 +84,7 @@ def test_check_exclude():
"tests/files/issues/sigma_rule_with_bad_references.yml",
],
)
assert result.exit_code == 0
assert result.exit_code == 1
assert "Invalid validators name" in result.stdout
assert "myvalidator" in result.stdout
assert "Ignoring these validators" in result.stdout
3 changes: 2 additions & 1 deletion tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def test_convert_output_list_of_str():

def test_convert_stdin():
cli = CliRunner()
input = open("tests/files/valid/sigma_rule.yml", "rt").read()
with open("tests/files/valid/sigma_rule.yml", "rt") as yml_file:
input = yml_file.read()
result = cli.invoke(
convert,
[
Expand Down

0 comments on commit cd5e47e

Please sign in to comment.