Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/protobuf/python/google/protobuf/internal/generator_test.py

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #! /usr/bin/env python 1 #! /usr/bin/env python
2 # 2 #
3 # Protocol Buffers - Google's data interchange format 3 # Protocol Buffers - Google's data interchange format
4 # Copyright 2008 Google Inc. All rights reserved. 4 # Copyright 2008 Google Inc. All rights reserved.
5 # https://developers.google.com/protocol-buffers/ 5 # https://developers.google.com/protocol-buffers/
6 # 6 #
7 # Redistribution and use in source and binary forms, with or without 7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions are 8 # modification, are permitted provided that the following conditions are
9 # met: 9 # met:
10 # 10 #
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 def testFileDescriptor(self): 221 def testFileDescriptor(self):
222 self.assertEqual(unittest_pb2.DESCRIPTOR.name, 222 self.assertEqual(unittest_pb2.DESCRIPTOR.name,
223 'google/protobuf/unittest.proto') 223 'google/protobuf/unittest.proto')
224 self.assertEqual(unittest_pb2.DESCRIPTOR.package, 'protobuf_unittest') 224 self.assertEqual(unittest_pb2.DESCRIPTOR.package, 'protobuf_unittest')
225 self.assertFalse(unittest_pb2.DESCRIPTOR.serialized_pb is None) 225 self.assertFalse(unittest_pb2.DESCRIPTOR.serialized_pb is None)
226 self.assertEqual(unittest_pb2.DESCRIPTOR.dependencies, 226 self.assertEqual(unittest_pb2.DESCRIPTOR.dependencies,
227 [unittest_import_pb2.DESCRIPTOR]) 227 [unittest_import_pb2.DESCRIPTOR])
228 self.assertEqual(unittest_import_pb2.DESCRIPTOR.dependencies, 228 self.assertEqual(unittest_import_pb2.DESCRIPTOR.dependencies,
229 [unittest_import_public_pb2.DESCRIPTOR]) 229 [unittest_import_public_pb2.DESCRIPTOR])
230 230 self.assertEqual(unittest_import_pb2.DESCRIPTOR.public_dependencies,
231 [unittest_import_public_pb2.DESCRIPTOR])
231 def testNoGenericServices(self): 232 def testNoGenericServices(self):
232 self.assertTrue(hasattr(unittest_no_generic_services_pb2, "TestMessage")) 233 self.assertTrue(hasattr(unittest_no_generic_services_pb2, "TestMessage"))
233 self.assertTrue(hasattr(unittest_no_generic_services_pb2, "FOO")) 234 self.assertTrue(hasattr(unittest_no_generic_services_pb2, "FOO"))
234 self.assertTrue(hasattr(unittest_no_generic_services_pb2, "test_extension")) 235 self.assertTrue(hasattr(unittest_no_generic_services_pb2, "test_extension"))
235 236
236 # Make sure unittest_no_generic_services_pb2 has no services subclassing 237 # Make sure unittest_no_generic_services_pb2 has no services subclassing
237 # Proto2 Service class. 238 # Proto2 Service class.
238 if hasattr(unittest_no_generic_services_pb2, "TestService"): 239 if hasattr(unittest_no_generic_services_pb2, "TestService"):
239 self.assertFalse(issubclass(unittest_no_generic_services_pb2.TestService, 240 self.assertFalse(issubclass(unittest_no_generic_services_pb2.TestService,
240 service.Service)) 241 service.Service))
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 'protobuf_unittest.TestAllTypes.NestedEnum').full_name) 340 'protobuf_unittest.TestAllTypes.NestedEnum').full_name)
340 341
341 def testFindFileByName(self): 342 def testFindFileByName(self):
342 self.assertEqual( 343 self.assertEqual(
343 'google/protobuf/unittest.proto', 344 'google/protobuf/unittest.proto',
344 symbol_database.Default().pool.FindFileByName( 345 symbol_database.Default().pool.FindFileByName(
345 'google/protobuf/unittest.proto').name) 346 'google/protobuf/unittest.proto').name)
346 347
347 if __name__ == '__main__': 348 if __name__ == '__main__':
348 unittest.main() 349 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698