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
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')