Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
add record add command unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmostafa committed Jun 3, 2021
1 parent cf65bd1 commit b0ac0aa
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions tests/dmcli/groups/test_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,25 @@ def test_record_add_command(mocker):
)


# def test_record_delete_command():
# """Test `dmcli record delete`."""
# runner = CliRunner()
# result = runner.invoke(record)

# assert (
# result.output.splitlines()[0] == "Usage: record [OPTIONS] COMMAND [ARGS]..."
# ), "base record command not outputting usage."
def test_record_delete_command(mocker):
"""Test `dmcli record delete`."""
mocker.patch(
"dmcli.utils.api.get",
return_value=[{"name": "example.com"}],
)
mocker.patch(
"dmcli.utils.api.delete",
return_value="Record Successfully deleted",
)
runner = CliRunner()
result = runner.invoke(
record,
"delete",
input="\n".join(["example.com", "record-id"]),
)
print("YUP: ", result.output)
assert result.output.splitlines()[0] == "Domain name: example.com"
assert result.output.splitlines()[1] == "Record id: record-id"


# def test_record_update_command():
Expand Down

0 comments on commit b0ac0aa

Please sign in to comment.