]>
git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/tests/devices/test_zap.py
42c4940f157bd496f2d65bf9822bcc3981f0c956
2 from ceph_volume
.devices
import lvm
7 def test_main_spits_help_with_no_arguments(self
, capsys
):
9 stdout
, stderr
= capsys
.readouterr()
10 assert 'Zaps the given logical volume(s), raw device(s) or partition(s)' in stdout
12 def test_main_shows_full_help(self
, capsys
):
13 with pytest
.raises(SystemExit):
14 lvm
.zap
.Zap(argv
=['--help']).main()
15 stdout
, stderr
= capsys
.readouterr()
16 assert 'optional arguments' in stdout
18 @pytest.mark
.parametrize('device_name', [
22 def test_can_not_zap_mapper_device(self
, monkeypatch
, device_info
, capsys
, is_root
, device_name
):
23 monkeypatch
.setattr('os.path.exists', lambda x
: True)
25 with pytest
.raises(SystemExit):
26 lvm
.zap
.Zap(argv
=[device_name
]).main()
27 stdout
, stderr
= capsys
.readouterr()
28 assert 'Refusing to zap' in stderr