-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_source_commands.py
More file actions
58 lines (45 loc) · 1.99 KB
/
test_source_commands.py
File metadata and controls
58 lines (45 loc) · 1.99 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""Tests for source commands."""
import pytest
from click.testing import CliRunner
from dremio_cli.cli import cli
@pytest.fixture
def runner():
"""Create CLI test runner."""
return CliRunner()
class TestSourceCommands:
"""Test source commands."""
def test_source_list_help(self, runner):
"""Test source list help."""
result = runner.invoke(cli, ["source", "list", "--help"])
assert result.exit_code == 0
assert "List all sources" in result.output
def test_source_get_help(self, runner):
"""Test source get help."""
result = runner.invoke(cli, ["source", "get", "--help"])
assert result.exit_code == 0
assert "Get source by ID" in result.output
def test_source_create_help(self, runner):
"""Test source create help."""
result = runner.invoke(cli, ["source", "create", "--help"])
assert result.exit_code == 0
assert "Create a new source" in result.output
def test_source_update_help(self, runner):
"""Test source update help."""
result = runner.invoke(cli, ["source", "update", "--help"])
assert result.exit_code == 0
assert "Update an existing source" in result.output
def test_source_refresh_help(self, runner):
"""Test source refresh help."""
result = runner.invoke(cli, ["source", "refresh", "--help"])
assert result.exit_code == 0
assert "Refresh source metadata" in result.output
def test_source_delete_help(self, runner):
"""Test source delete help."""
result = runner.invoke(cli, ["source", "delete", "--help"])
assert result.exit_code == 0
assert "Delete a source" in result.output
def test_source_test_connection_help(self, runner):
"""Test source test-connection help."""
result = runner.invoke(cli, ["source", "test-connection", "--help"])
assert result.exit_code == 0
assert "Test source connection" in result.output