예제 #1
0
 def test_missingEnd_expectFailed(self):
     f = testdata.filePath('blender_pidstat_dump_missing_end.txt')
     parsed = profilers.PidStatParser(f).parse()
     self.assertFalse(parsed)
예제 #2
0
 def setUp(self):
     self.filePath = testdata.filePath('blender_perfstat_dump.txt')
     with open(self.filePath, 'r') as fp:
         self.text = fp.read()
예제 #3
0
 def test_expectSampleDetails(self):
     f = testdata.filePath('blender_pidstat_dump.txt')
     parsed = profilers.PidStatParser(f).parse()
     sample = parsed['samples'][5]
     self.assertEqual(16368, sample[3]['TID'])
예제 #4
0
 def setUp(self):
     self.filePath = testdata.filePath('blender_pidstat_dump.txt')
     with open(self.filePath, 'r') as fp:
         self.lines = fp.readlines()
     self.it = iter(self.lines)
예제 #5
0
 def test_expectNumOfSamples(self):
     f = testdata.filePath('blender_pidstat_dump.txt')
     parsed = profilers.PidStatParser(f).parse()
     self.assertEqual(13, len(parsed['samples']))
예제 #6
0
 def test_expectErrorKey(self):
     f = testdata.filePath('blender_pidstat_dump.txt')
     parsed = profilers.PidStatParser(f).parse()
     self.assertTrue('error' in parsed)
예제 #7
0
 def test_expectParsedStruct(self):
     f = testdata.filePath('blender_pidstat_dump.txt')
     parsed = profilers.PidStatParser(f).parse()
     self.assertTrue(parsed)