Skip to content

Commit

Permalink
Added test to validate exit on help in empty config
Browse files Browse the repository at this point in the history
  • Loading branch information
ntlhui committed Mar 3, 2023
1 parent e222d56 commit cc93e7f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from typing import Tuple
from unittest.mock import Mock, patch

import pytest

from e4e_data_management.cli import main
from e4e_data_management.core import DataManager
from e4e_data_management.metadata import Metadata
Expand Down Expand Up @@ -218,3 +220,10 @@ def test_list(single_mission: Tuple[Mock, DataManager, Path]):
with patch('sys.argv', args):
main()
mock.list_datasets.assert_called_once_with()

def test_inactive_commands():
"""Tests that inactive environment doesn't break --help
"""
args = split('e4edm --help')
with patch('sys.argv', args), pytest.raises(SystemExit):
main()

0 comments on commit cc93e7f

Please sign in to comment.