def test_missingEnd_expectFailed(self): f = testdata.filePath('blender_pidstat_dump_missing_end.txt') parsed = profilers.PidStatParser(f).parse() self.assertFalse(parsed)
def setUp(self): self.filePath = testdata.filePath('blender_perfstat_dump.txt') with open(self.filePath, 'r') as fp: self.text = fp.read()
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'])
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)
def test_expectNumOfSamples(self): f = testdata.filePath('blender_pidstat_dump.txt') parsed = profilers.PidStatParser(f).parse() self.assertEqual(13, len(parsed['samples']))
def test_expectErrorKey(self): f = testdata.filePath('blender_pidstat_dump.txt') parsed = profilers.PidStatParser(f).parse() self.assertTrue('error' in parsed)
def test_expectParsedStruct(self): f = testdata.filePath('blender_pidstat_dump.txt') parsed = profilers.PidStatParser(f).parse() self.assertTrue(parsed)