X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fceph-volume%2Fceph_volume%2Ftests%2Fsystemd%2Ftest_main.py;fp=src%2Fceph%2Fsrc%2Fceph-volume%2Fceph_volume%2Ftests%2Fsystemd%2Ftest_main.py;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=86a685ab515740131e6da10be034e867f43b975d;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/ceph-volume/ceph_volume/tests/systemd/test_main.py b/src/ceph/src/ceph-volume/ceph_volume/tests/systemd/test_main.py deleted file mode 100644 index 86a685a..0000000 --- a/src/ceph/src/ceph-volume/ceph_volume/tests/systemd/test_main.py +++ /dev/null @@ -1,51 +0,0 @@ -import pytest -from ceph_volume import exceptions, conf -from ceph_volume.systemd import main - - -class TestParseSubcommand(object): - - def test_no_subcommand_found(self): - with pytest.raises(exceptions.SuffixParsingError): - main.parse_subcommand('') - - def test_sub_command_is_found(self): - result = main.parse_subcommand('lvm-1-sha-1-something-0') - assert result == 'lvm' - - -class Capture(object): - - def __init__(self, *a, **kw): - self.a = a - self.kw = kw - self.calls = [] - - def __call__(self, *a, **kw): - self.calls.append(a) - self.calls.append(kw) - - -class TestMain(object): - - def setup(self): - conf.log_path = '/tmp/' - - def test_no_arguments_parsing_error(self): - with pytest.raises(RuntimeError): - main.main(args=[]) - - def test_parsing_suffix_error(self): - with pytest.raises(exceptions.SuffixParsingError): - main.main(args=['asdf']) - - def test_correct_command(self, monkeypatch): - run = Capture() - monkeypatch.setattr(main.process, 'run', run) - main.main(args=['ceph-volume-systemd', 'lvm-8715BEB4-15C5-49DE-BA6F-401086EC7B41-0' ]) - command = run.calls[0][0] - assert command == [ - 'ceph-volume', - 'lvm', 'trigger', - '8715BEB4-15C5-49DE-BA6F-401086EC7B41-0' - ]