Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
35 lines (22 loc) · 1021 Bytes

File metadata and controls

35 lines (22 loc) · 1021 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""Tests the CLI interface for DomainTools APIs"""
import pytest
import os
from typer.testing import CliRunner
from domaintools.cli import dt_cli
from domaintools._version import current
runner = CliRunner()
def test_match_cli_version():
result = runner.invoke(dt_cli, ["--version"])
expected_res = f"DomainTools CLI API Client {current}"
assert expected_res == result.stdout.strip()
def test_valid_command():
user = os.environ.get("TEST_USER", "test")
key = os.environ.get("TEST_KEY", "key")
result = runner.invoke(dt_cli, ["account_information", "--help"])
assert "Provides a snapshot of your accounts current API usage." in result.stdout
def test_invalid_command():
result = runner.invoke(dt_cli, ["test_invalid_command"])
assert "No such command 'test_invalid_command'." in result.stdout
def test_no_creds_file_not_found():
result = runner.invoke(dt_cli, ["iris_investigate", "--domain", "domaintools.com"])
assert "No such file or directory" in result.stdout
Morty Proxy This is a proxified and sanitized view of the page, visit original site.