Skip to content

Commit 3dc2210

Browse files
committed
Fix code coverage regarding MooseFSSR and ZFSSR (#29)
Signed-off-by: Ronan Abhamon <[email protected]>
1 parent 0e496c6 commit 3dc2210

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
@@ -53,9 +53,7 @@ def test_load_with_zfs_unavailable(self):
5353
self.create_zfs_sr()
5454
except SR.SROSError as e:
5555
# Check SRUnavailable error.
56-
if e.errno != 47:
57-
raise
58-
failed = True
56+
failed = e.errno == 47
5957
self.assertTrue(failed)
6058

6159
@mock.patch('ZFSSR.is_zfs_available', autospec=True)
@@ -80,9 +78,7 @@ def test_create_with_invalid_zfs_path(
8078
sr.create(sr.uuid, 42)
8179
except SR.SROSError as e:
8280
# Check ZFSSRCreate error.
83-
if e.errno != 5000:
84-
raise
85-
failed = True
81+
failed = e.errno == 5000
8682
self.assertTrue(failed)
8783

8884
@mock.patch('ZFSSR.is_zfs_available', autospec=True)
@@ -115,7 +111,5 @@ def test_scan_with_invalid_zfs_path(
115111
sr.scan(sr.uuid)
116112
except SR.SROSError as e:
117113
# Check SRUnavailable error.
118-
if e.errno != 47:
119-
raise
120-
failed = True
114+
failed = e.errno == 47
121115
self.assertTrue(failed)

0 commit comments

Comments
 (0)