Пример #1
0
 def testFailIfInconsistentStride(self, mock_fatal_error):
     cpu_ids = [1, 3, 5, 8]
     checkProcessorIDContent(cpu_ids)
     self.assertTrue(mock_fatal_error.called)
Пример #2
0
 def testFailIfAnElementIsNonInt(self, mock_fatal_error):
     cpu_ids = [1, 2, 3.5, 4, 5]
     checkProcessorIDContent(cpu_ids)
     self.assertTrue(mock_fatal_error.called)
Пример #3
0
 def testFailIfNegativeIDs(self, mock_fatal_error):
     cpu_ids = [-1, 3]
     checkProcessorIDContent(cpu_ids)
     self.assertTrue(mock_fatal_error.called)
Пример #4
0
 def testFailIfContentsString(self, mock_fatal_error):
     cpu_ids = ["1"]
     checkProcessorIDContent(cpu_ids)
     self.assertTrue(mock_fatal_error.called)
Пример #5
0
 def testFailIfContentsFloat(self, mock_fatal_error):
     cpu_ids = [1.5]
     checkProcessorIDContent(cpu_ids)
     self.assertTrue(mock_fatal_error.called)
Пример #6
0
 def testFailIfNotList(self, mock_fatal_error):
     cpu_ids = 1
     with self.assertRaises(TypeError):
         checkProcessorIDContent(cpu_ids)
     self.assertTrue(mock_fatal_error.called)
Пример #7
0
 def testGoodLongStride(self):
     cpu_ids = [1, 4, 7]
     checkProcessorIDContent(cpu_ids)
Пример #8
0
 def testGoodMultipleProcessors(self):
     cpu_ids = [1, 2]
     checkProcessorIDContent(cpu_ids)
Пример #9
0
 def testGoodOffsetFromZero(self):
     cpu_ids = [1]
     checkProcessorIDContent(cpu_ids)
Пример #10
0
 def testGoodSingleProcessor(self):
     cpu_ids = [0]
     checkProcessorIDContent(cpu_ids)