(self)
| 48 | profiler.stop() |
| 49 | |
| 50 | def test_save_profile(self): |
| 51 | logdir = self.get_temp_dir() |
| 52 | profile_pb = trace_events_pb2.Trace() |
| 53 | profile_result = profile_pb.SerializeToString() |
| 54 | profiler.save(logdir, profile_result) |
| 55 | file_list = gfile.ListDirectory(logdir) |
| 56 | self.assertEqual(len(file_list), 2) |
| 57 | for file_name in gfile.ListDirectory(logdir): |
| 58 | if gfile.IsDirectory(os.path.join(logdir, file_name)): |
| 59 | self.assertEqual(file_name, 'plugins') |
| 60 | else: |
| 61 | self.assertTrue(file_name.endswith('.profile-empty')) |
| 62 | |
| 63 | |
| 64 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected