From 3d5e391693fc64747a4774287c968f842294eaa6 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Mon, 23 Oct 2017 09:51:43 -0500 Subject: [PATCH] ceph-volume: add tests for ceph-volume lvm zap Signed-off-by: Andrew Schoen --- .../ceph_volume/tests/devices/test_zap.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/ceph-volume/ceph_volume/tests/devices/test_zap.py diff --git a/src/ceph-volume/ceph_volume/tests/devices/test_zap.py b/src/ceph-volume/ceph_volume/tests/devices/test_zap.py new file mode 100644 index 0000000000000..bc26e33da5c33 --- /dev/null +++ b/src/ceph-volume/ceph_volume/tests/devices/test_zap.py @@ -0,0 +1,17 @@ +import pytest +from ceph_volume.devices import lvm + + +class TestZap(object): + + def test_main_spits_help_with_no_arguments(self, capsys): + lvm.zap.Zap([]).main() + stdout, stderr = capsys.readouterr() + assert 'Zaps the given logical volume or partition' in stdout + + def test_main_shows_full_help(self, capsys): + with pytest.raises(SystemExit): + lvm.zap.Zap(argv=['--help']).main() + stdout, stderr = capsys.readouterr() + assert 'optional arguments' in stdout + assert 'positional arguments' in stdout -- 2.39.5