]>
git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/tests/test_main.py
3 from ceph_volume
import main
6 class TestVolume(object):
8 def test_main_spits_help_with_no_arguments(self
, capsys
):
10 stdout
, stderr
= capsys
.readouterr()
11 assert 'Log Path' in stdout
13 def test_warn_about_using_help_for_full_options(self
, capsys
):
15 stdout
, stderr
= capsys
.readouterr()
16 assert 'See "ceph-volume --help" for full list' in stdout
18 def test_environ_vars_show_up(self
, capsys
):
19 os
.environ
['CEPH_CONF'] = '/opt/ceph.conf'
21 stdout
, stderr
= capsys
.readouterr()
22 assert 'CEPH_CONF' in stdout
23 assert '/opt/ceph.conf' in stdout
25 def test_flags_are_parsed_with_help(self
, capsys
):
26 with pytest
.raises(SystemExit):
27 main
.Volume(argv
=['ceph-volume', '--help'])
28 stdout
, stderr
= capsys
.readouterr()
29 assert '--cluster' in stdout
30 assert '--log-path' in stdout