示例#1
0
 def set_up_mock(self, filemock):
     fs_mock = Mock()
     filemock.return_value = fs_mock
     fs_mock.readline.return_value = 'test_hostname'
     data = Plugin.data()
     return data
示例#2
0
 def test_plugin_open_hostname_file(self, filemock):
     fs_mock = Mock()
     filemock.return_value = fs_mock
     fs_mock.read.return_value = 'test_hostname'
     Plugin.data()
     filemock.assert_called_with('/proc/sys/kernel/hostname')