Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
samriddhi99 committed Jul 10, 2024
1 parent 6eb2fe1 commit 045c929
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/tirith/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ def __init__(self, prog="PROG") -> None:

try:
result = start_policy_evaluation(args.policyPath, args.inputPath)



if args.json:
formatted_result = json.dumps(result, indent=3)
print(formatted_result)
Expand All @@ -121,7 +120,7 @@ def __init__(self, prog="PROG") -> None:

if result["final_result"] == False:
return ExitStatus.ERROR

return ExitStatus.SUCCESS
except Exception as e:
# TODO:write an exception class for all provider exceptions.
Expand Down
12 changes: 7 additions & 5 deletions tests/core/test_end_to_end.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import pytest
import pytest
import subprocess
import os


def run_cmd(command):
process = subprocess.Popen(command,stdout=subprocess.PIPE, stdin= subprocess.PIPE, shell = True)
process = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, shell=True)
stdout, stderr = process.communicate()

return process.returncode


def test_end_to_end():
policy_file_name = f"{os.path.dirname(os.path.abspath(__file__))}/fixtures/apigateway_state_logging_enabled.tirith.json"
policy_file_name = (
f"{os.path.dirname(os.path.abspath(__file__))}/fixtures/apigateway_state_logging_enabled.tirith.json"
)
input_file_name = f"{os.path.dirname(os.path.abspath(__file__))}/fixtures/plan.json"
command = f"tirith -policy-path {policy_file_name} -input-path {input_file_name}"
returncode = run_cmd(command)

assert returncode == 1

0 comments on commit 045c929

Please sign in to comment.