Esempio n. 1
0
 def test_get_total_memory_linux(self):
     """Test the function that gets the total memory."""
     st.get_os_type = lambda: st.LINUX
     st.read_file = mocked_read_file
     st.os.path.exists = lambda fp: mocked_os_path_exists(
         PROC_MEMINFO_FP, fp)
     self.assertEqual(get_total_memory(), 64510)
Esempio n. 2
0
 def test_get_total_memory_native(self):
     """Test the function that gets the total memory."""
     memtotal = get_total_memory()
     self.assertTrue(isinstance(memtotal, int))
Esempio n. 3
0
 def test_get_total_memory_darwin(self):
     """Test the function that gets the total memory."""
     st.get_os_type = lambda: st.DARWIN
     st.run_cmd = mocked_run_cmd
     self.assertEqual(get_total_memory(), 8192)
Esempio n. 4
0
 def test_get_total_memory_native(self):
     """Test the function that gets the total memory."""
     memtotal = get_total_memory()
     self.assertTrue(isinstance(memtotal, int))
Esempio n. 5
0
 def test_get_total_memory_darwin(self):
     """Test the function that gets the total memory."""
     st.get_os_type = lambda: st.DARWIN
     st.run_cmd = mocked_run_cmd
     self.assertEqual(get_total_memory(), 8192)
Esempio n. 6
0
 def test_get_total_memory_linux(self):
     """Test the function that gets the total memory."""
     st.get_os_type = lambda: st.LINUX
     st.read_file = mocked_read_file
     st.is_readable = lambda fp: mocked_is_readable(PROC_MEMINFO_FP, fp)
     self.assertEqual(get_total_memory(), 64510)