mirror of
https://github.com/ceph/ceph
synced 2024-12-25 21:03:31 +00:00
ceph-volume tests.simple add checks for get_contents in scan
Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
parent
827aa57557
commit
647bfe0883
@ -0,0 +1,19 @@
|
||||
from ceph_volume.devices.simple import scan
|
||||
|
||||
|
||||
class TestGetContentst(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'
|
Loading…
Reference in New Issue
Block a user