def testChartJSON(self):
   with mock.patch('__builtin__.open',
       mock.mock_open(read_data='{"charts": 1}')):
     self.assertFalse(ppr_module._is_gtest('test.json'))
     self.assertFalse(ppr_module._is_histogram('test.json'))
   self.assertFalse(ppr_module._is_gtest('test.json'))
   self.assertFalse(ppr_module._is_histogram('test.json'))
Пример #2
0
 def testHistogram(self):
     with mock.patch(BUILTIN_MODULE + '.open',
                     mock.mock_open(read_data='[]')):
         self.assertTrue(ppr_module._is_histogram('test.json'))
         self.assertFalse(ppr_module._is_gtest('test.json'))
     self.assertTrue(ppr_module._is_histogram('test.json'))
     self.assertFalse(ppr_module._is_gtest('test.json'))
 def testHistogram(self):
   with mock.patch('__builtin__.open', mock.mock_open(read_data='[]')):
     self.assertTrue(ppr_module._is_histogram('test.json'))
     self.assertFalse(ppr_module._is_gtest('test.json'))
   self.assertTrue(ppr_module._is_histogram('test.json'))
   self.assertFalse(ppr_module._is_gtest('test.json'))