Exemple #1
0
 def set_up_mock(self, filemock):
     fs_mock = Mock()
     filemock.return_value = fs_mock
     fs_mock.read.return_value = 'MemTotal: 1234 kB\nMemFree: 544 kB\nBuffers: 654 kB\n'
     data = Plugin.data()
     return data
Exemple #2
0
 def test_plugin_open_meminfo(self, filemock):
     fs_mock = Mock()
     filemock.return_value = fs_mock
     fs_mock.read.return_value = 'MemTotal: 1234 kB\nMemFree: 544 kB\nBuffers: 654 kB\n'
     Plugin.data()
     filemock.assert_called_with('/proc/meminfo')