Skip to content

Commit

Permalink
Bug Fix For CLI crash (#82)
Browse files Browse the repository at this point in the history
Fixed import statement and added a test file for the cli
  • Loading branch information
daralynnrhode authored Aug 19, 2024
1 parent ff6c637 commit 7657856
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 1 addition & 2 deletions imap_data_access/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
import os
from pathlib import Path

from file_validation import ScienceFilePath

import imap_data_access
from imap_data_access.file_validation import ScienceFilePath


def _download_parser(args: argparse.Namespace):
Expand Down
16 changes: 16 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Tests for the CLI options."""

import sys
from unittest import mock

import pytest

from imap_data_access import cli


def test_cli_works():
"""Smoke test for the CLI module making sure it is callable."""
with mock.patch.object(sys, "argv", ["imap-data-access", "-h"]):
# Should have a 0 SystemExit return code if successful
with pytest.raises(SystemExit, match="0"):
cli.main()

0 comments on commit 7657856

Please sign in to comment.