Skip to content

Commit

Permalink
feat: init remote config file integration tests
Browse files Browse the repository at this point in the history
This commit initializes the integration testing associated with the
ability to pull remote configuration files.
  • Loading branch information
simojo committed Nov 6, 2023
1 parent 7e7a9f2 commit 5ff526b
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,91 @@ def test_cli_analyze_incorrect_arguments_correct_config(tmpdir):
assert "Cannot perform analysis due to configuration" in result.output


def test_cli_analyze_url_config(FIXME):
"""Confirm that using the command-line interface correctly handles a valid URL configuration."""
# FIXME
config_url = "FIXME"
project_name = "test"
# call the analyze command
result = runner.invoke(
main.cli,
[
"analyze",
project_name,
"--search-path",
test_one,
"--config",
config_url,
"--verbose",
],
)
assert result.exit_code == 0


def test_cli_analyze_url_config_invalid_checks_files(FIXME):
"""Confirm that using the command-line interface aborts execution when given a URL config that uses local file paths to specify checks files."""
# FIXME
config_url = "FIXME"
project_name = "test"
# call the analyze command
result = runner.invoke(
main.cli,
[
"analyze",
project_name,
"--search-path",
test_one,
"--config",
config_url,
"--verbose",
],
)
assert result.exit_code == 1
assert "Cannot perform analysis due to configuration" in result.output


def test_cli_analyze_correct_config_but_url_based_checks_files(FIXME):
"""Confirm that using the command-line interface correctly handles a local config that references URL endpoints for each checks file."""
# FIXME
config_url = "FIXME"
project_name = "test"
# call the analyze command
result = runner.invoke(
main.cli,
[
"analyze",
project_name,
"--search-path",
test_one,
"--config",
config_url,
"--verbose",
],
)
assert result.exit_code == 0


def test_cli_analyze_correct_config_but_url_and_filesystem_checks_files(FIXME):
"""Confirm that using the command-line interface correctly handles a local config that references a combination of URL endpoints and local files for each checks file."""
# FIXME
config_url = "FIXME"
project_name = "test"
# call the analyze command
result = runner.invoke(
main.cli,
[
"analyze",
project_name,
"--search-path",
test_one,
"--config",
config_url,
"--verbose",
],
)
assert result.exit_code == 0


@patch("chasten.configuration.user_config_dir")
def test_cli_configure_create_config_when_does_not_exist(
mock_user_config_dir, tmp_path
Expand Down

0 comments on commit 5ff526b

Please sign in to comment.