Skip to content

Commit

Permalink
test: adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
negar-abbasi committed Aug 9, 2023
1 parent 8cc2949 commit 1d5a29b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tests/goal/test_goal.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,26 @@ def test_goal_simple_args_with_input_file() -> None:

@pytest.mark.usefixtures("proc_mock")
def test_goal_simple_args_with_output_file() -> None:
result = invoke("goal clerk compile approval.compiled")
result = invoke("goal account dump -o balance_record.json")

assert result.exit_code == 0
verify(result.output)


@pytest.mark.usefixtures("proc_mock")
def test_goal_simple_args_with_input_output_files() -> None:
result = invoke("goal clerk compile approval.teal approval.compiled")
def test_goal_simple_args_with_input_output_files(proc_mock: ProcMock, mocker: MockerFixture) -> None:

result = invoke("goal clerk compile approval.teal -o test.compiled")

assert proc_mock.called[1].command[9] == "/root/goal_mount/approval.teal"
assert proc_mock.called[1].command[11] == "/root/goal_mount/test.compiled"

assert result.exit_code == 0
verify(result.output)


def test_goal_simple_args_with_multiple_input_output_files() -> None:
result = invoke("goal clerk compile approval1.teal approval2.teal approval.compiled")

assert result.exit_code == 0
verify(result.output)
Expand Down

0 comments on commit 1d5a29b

Please sign in to comment.