Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_readlink_samename(self, mock_time):
osd.__salt__ = {}
osd.__salt__['helper.run'] = mock.Mock()
osd.__salt__['helper.run'].return_value = ('', '/dev/disk/by-id/wwn-0x12345-part1', '')
result = osd.readlink("/dev/disk/by-id/wwn-0x12345-part1")
assert result == "/dev/disk/by-id/wwn-0x12345-part1"
@pytest.mark.skip(reason="Low priority: skipped")
class TetstOSDState():
pass
fs = fake_fs.FakeFilesystem()
f_glob = fake_glob.FakeGlobModule(fs)
f_os = fake_fs.FakeOsModule(fs)
f_open = fake_fs.FakeFileOpen(fs)
class TestOSDWeight():
"""
Initial checks for the wait method. Override the __init__ funciton to
avoid the rados logic. Set osd_id and settings directly.
"""
@patch('builtins.open', new=f_open)
@patch('srv.salt._modules.osd.OSDWeight.osd_df')
def test_save_defaults(self, osd_df):
"""
No files created with default values
"""
osd_df.return_value = {'crush_weight': 0,