X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fceph-volume%2Fceph_volume%2Ftests%2Fdevices%2Fsimple%2Ftest_scan.py;fp=src%2Fceph%2Fsrc%2Fceph-volume%2Fceph_volume%2Ftests%2Fdevices%2Fsimple%2Ftest_scan.py;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=d68fe63cb65b883316662ebde11b364ce1b5c1c9;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/ceph-volume/ceph_volume/tests/devices/simple/test_scan.py b/src/ceph/src/ceph-volume/ceph_volume/tests/devices/simple/test_scan.py deleted file mode 100644 index d68fe63..0000000 --- a/src/ceph/src/ceph-volume/ceph_volume/tests/devices/simple/test_scan.py +++ /dev/null @@ -1,52 +0,0 @@ -import os -import pytest -from ceph_volume.devices.simple import scan - - -class TestScan(object): - - def test_main_spits_help_with_no_arguments(self, capsys): - scan.Scan([]).main() - stdout, stderr = capsys.readouterr() - assert 'Scan an OSD directory for files' in stdout - - -class TestGetContents(object): - - def test_multiple_lines_are_left_as_is(self, tmpfile): - magic_file = tmpfile(contents='first\nsecond\n') - scanner = scan.Scan([]) - assert scanner.get_contents(magic_file) == 'first\nsecond\n' - - def test_extra_whitespace_gets_removed(self, tmpfile): - magic_file = tmpfile(contents='first ') - scanner = scan.Scan([]) - assert scanner.get_contents(magic_file) == 'first' - - def test_single_newline_values_are_trimmed(self, tmpfile): - magic_file = tmpfile(contents='first\n') - scanner = scan.Scan([]) - assert scanner.get_contents(magic_file) == 'first' - - -class TestEtcPath(object): - - def test_directory_is_valid(self, tmpdir): - path = str(tmpdir) - scanner = scan.Scan([]) - scanner._etc_path = path - assert scanner.etc_path == path - - def test_directory_does_not_exist_gets_created(self, tmpdir): - path = os.path.join(str(tmpdir), 'subdir') - scanner = scan.Scan([]) - scanner._etc_path = path - assert scanner.etc_path == path - assert os.path.isdir(path) - - def test_complains_when_file(self, tmpfile): - path = tmpfile() - scanner = scan.Scan([]) - scanner._etc_path = path - with pytest.raises(RuntimeError): - scanner.etc_path