]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: add tests for ceph-volume lvm zap
authorAndrew Schoen <aschoen@redhat.com>
Mon, 23 Oct 2017 14:51:43 +0000 (09:51 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Fri, 27 Oct 2017 16:15:44 +0000 (11:15 -0500)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
src/ceph-volume/ceph_volume/tests/devices/test_zap.py [new file with mode: 0644]

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 (file)
index 0000000..bc26e33
--- /dev/null
@@ -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