Skip to content

Commit 18c7a8f

Browse files
Wescoeurstormi
authored andcommitted
Fix code coverage regarding MooseFSSR and ZFSSR (#29)
Signed-off-by: Ronan Abhamon <[email protected]>
1 parent ebcdc33 commit 18c7a8f

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

tests/test_MooseFSSR.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ def create_moosefssr(self, masterhost='aServer', rootpath='/aServerpath',
2323
'masterhost': masterhost,
2424
'rootpath': rootpath
2525
}
26-
if useroptions:
27-
srcmd.dconf.update({'options': useroptions})
2826
srcmd.params = {
2927
'command': 'some_command',
3028
'device_config': {}

tests/test_ZFSSR.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ def test_load_with_zfs_unavailable(self):
5050
self.create_zfs_sr()
5151
except SR.SROSError as e:
5252
# Check SRUnavailable error.
53-
if e.errno != 47:
54-
raise
55-
failed = True
53+
failed = e.errno == 47
5654
self.assertTrue(failed)
5755

5856
@mock.patch('ZFSSR.is_zfs_available', autospec=True)
@@ -77,9 +75,7 @@ def test_create_with_invalid_zfs_path(
7775
sr.create(sr.uuid, 42)
7876
except SR.SROSError as e:
7977
# Check ZFSSRCreate error.
80-
if e.errno != 5000:
81-
raise
82-
failed = True
78+
failed = e.errno == 5000
8379
self.assertTrue(failed)
8480

8581
@mock.patch('ZFSSR.is_zfs_available', autospec=True)
@@ -112,7 +108,5 @@ def test_scan_with_invalid_zfs_path(
112108
sr.scan(sr.uuid)
113109
except SR.SROSError as e:
114110
# Check SRUnavailable error.
115-
if e.errno != 47:
116-
raise
117-
failed = True
111+
failed = e.errno == 47
118112
self.assertTrue(failed)

0 commit comments

Comments
 (0)