ceph-volume tests.util verify ValidDevice validator

Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
Alfredo Deza 2018-08-23 10:31:16 -04:00
parent 57f76e36ab
commit 649903bdab

View File

@ -96,3 +96,17 @@ class TestExcludeGroupOptions(object):
)
stdout, stderr = capsys.readouterr()
assert 'Cannot use --filestore (filestore) with --bluestore (bluestore)' in stdout
class TestValidDevice(object):
def setup(self):
self.validator = arg_validators.ValidDevice()
def test_path_is_valid(self, fake_call):
result = self.validator('/')
assert result.abspath == '/'
def test_path_is_invalid(self, fake_call):
with pytest.raises(argparse.ArgumentError):
self.validator('/device/does/not/exist')