Example #1
0
 def testFailIfInconsistentStride(self, mock_fatal_error):
     cpu_ids = [1, 3, 5, 8]
     checkProcessorIDContent(cpu_ids)
     self.assertTrue(mock_fatal_error.called)
Example #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)
Example #3
0
 def testFailIfNegativeIDs(self, mock_fatal_error):
     cpu_ids = [-1, 3]
     checkProcessorIDContent(cpu_ids)
     self.assertTrue(mock_fatal_error.called)
Example #4
0
 def testFailIfContentsString(self, mock_fatal_error):
     cpu_ids = ["1"]
     checkProcessorIDContent(cpu_ids)
     self.assertTrue(mock_fatal_error.called)
Example #5
0
 def testFailIfContentsFloat(self, mock_fatal_error):
     cpu_ids = [1.5]
     checkProcessorIDContent(cpu_ids)
     self.assertTrue(mock_fatal_error.called)
Example #6
0
 def testFailIfNotList(self, mock_fatal_error):
     cpu_ids = 1
     with self.assertRaises(TypeError):
         checkProcessorIDContent(cpu_ids)
     self.assertTrue(mock_fatal_error.called)
Example #7
0
 def testGoodLongStride(self):
     cpu_ids = [1, 4, 7]
     checkProcessorIDContent(cpu_ids)
Example #8
0
 def testGoodMultipleProcessors(self):
     cpu_ids = [1, 2]
     checkProcessorIDContent(cpu_ids)
Example #9
0
 def testGoodOffsetFromZero(self):
     cpu_ids = [1]
     checkProcessorIDContent(cpu_ids)
Example #10
0
 def testGoodSingleProcessor(self):
     cpu_ids = [0]
     checkProcessorIDContent(cpu_ids)