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

Unified Diff: third_party/protobuf/python/google/protobuf/internal/descriptor_database_test.py

Issue 1842653006: Update //third_party/protobuf to version 3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/python/google/protobuf/internal/descriptor_database_test.py
diff --git a/third_party/protobuf/python/google/protobuf/internal/descriptor_database_test.py b/third_party/protobuf/python/google/protobuf/internal/descriptor_database_test.py
index d0ca7892244f7bee5913a0231835c56ec124cd54..1baff7d1d1550568ea3acd04bffeb42fb57abb00 100644
--- a/third_party/protobuf/python/google/protobuf/internal/descriptor_database_test.py
+++ b/third_party/protobuf/python/google/protobuf/internal/descriptor_database_test.py
@@ -1,8 +1,8 @@
-#! /usr/bin/python
+#! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
-# http://code.google.com/p/protobuf/
+# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -34,7 +34,10 @@
__author__ = 'matthewtoia@google.com (Matt Toia)'
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
from google.protobuf import descriptor_pb2
from google.protobuf.internal import factory_test2_pb2
from google.protobuf import descriptor_database
@@ -48,16 +51,18 @@ class DescriptorDatabaseTest(unittest.TestCase):
factory_test2_pb2.DESCRIPTOR.serialized_pb)
db.Add(file_desc_proto)
- self.assertEquals(file_desc_proto, db.FindFileByName(
- 'net/proto2/python/internal/factory_test2.proto'))
- self.assertEquals(file_desc_proto, db.FindFileContainingSymbol(
- 'net.proto2.python.internal.Factory2Message'))
- self.assertEquals(file_desc_proto, db.FindFileContainingSymbol(
- 'net.proto2.python.internal.Factory2Message.NestedFactory2Message'))
- self.assertEquals(file_desc_proto, db.FindFileContainingSymbol(
- 'net.proto2.python.internal.Factory2Enum'))
- self.assertEquals(file_desc_proto, db.FindFileContainingSymbol(
- 'net.proto2.python.internal.Factory2Message.NestedFactory2Enum'))
+ self.assertEqual(file_desc_proto, db.FindFileByName(
+ 'google/protobuf/internal/factory_test2.proto'))
+ self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
+ 'google.protobuf.python.internal.Factory2Message'))
+ self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
+ 'google.protobuf.python.internal.Factory2Message.NestedFactory2Message'))
+ self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
+ 'google.protobuf.python.internal.Factory2Enum'))
+ self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
+ 'google.protobuf.python.internal.Factory2Message.NestedFactory2Enum'))
+ self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
+ 'google.protobuf.python.internal.MessageWithNestedEnumOnly.NestedEnum'))
if __name__ == '__main__':
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698