Skip to content

Commit

Permalink
ceph-volume tests update tests to handle new SystemExit exceptions in…
Browse files Browse the repository at this point in the history
… main

Signed-off-by: Alfredo Deza <adeza@redhat.com>
  • Loading branch information
Alfredo Deza committed Nov 13, 2018
1 parent 9527cff commit 27d0a91
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ceph-volume/ceph_volume/tests/test_main.py
Expand Up @@ -6,18 +6,21 @@
class TestVolume(object):

def test_main_spits_help_with_no_arguments(self, capsys):
main.Volume(argv=[])
with pytest.raises(SystemExit):
main.Volume(argv=[])
stdout, stderr = capsys.readouterr()
assert 'Log Path' in stdout

def test_warn_about_using_help_for_full_options(self, capsys):
main.Volume(argv=[])
with pytest.raises(SystemExit):
main.Volume(argv=[])
stdout, stderr = capsys.readouterr()
assert 'See "ceph-volume --help" for full list' in stdout

def test_environ_vars_show_up(self, capsys):
os.environ['CEPH_CONF'] = '/opt/ceph.conf'
main.Volume(argv=[])
with pytest.raises(SystemExit):
main.Volume(argv=[])
stdout, stderr = capsys.readouterr()
assert 'CEPH_CONF' in stdout
assert '/opt/ceph.conf' in stdout
Expand Down

0 comments on commit 27d0a91

Please sign in to comment.