Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
dbea00ae
Commit
dbea00ae
authored
Oct 05, 2015
by
Jisi Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert back changes to import unittest2 for py26
parent
a783eaf3
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
64 additions
and
26 deletions
+64
-26
descriptor_database_test.py
python/google/protobuf/internal/descriptor_database_test.py
+4
-1
descriptor_pool_test.py
python/google/protobuf/internal/descriptor_pool_test.py
+4
-1
descriptor_test.py
python/google/protobuf/internal/descriptor_test.py
+5
-2
generator_test.py
python/google/protobuf/internal/generator_test.py
+4
-1
json_format_test.py
python/google/protobuf/internal/json_format_test.py
+4
-1
message_factory_test.py
python/google/protobuf/internal/message_factory_test.py
+4
-1
message_test.py
python/google/protobuf/internal/message_test.py
+4
-1
proto_builder_test.py
python/google/protobuf/internal/proto_builder_test.py
+4
-1
reflection_test.py
python/google/protobuf/internal/reflection_test.py
+6
-3
service_reflection_test.py
python/google/protobuf/internal/service_reflection_test.py
+4
-1
symbol_database_test.py
python/google/protobuf/internal/symbol_database_test.py
+4
-1
test_util.py
python/google/protobuf/internal/test_util.py
+0
-7
text_encoding_test.py
python/google/protobuf/internal/text_encoding_test.py
+4
-1
text_format_test.py
python/google/protobuf/internal/text_format_test.py
+4
-1
unknown_fields_test.py
python/google/protobuf/internal/unknown_fields_test.py
+5
-2
wire_format_test.py
python/google/protobuf/internal/wire_format_test.py
+4
-1
No files found.
python/google/protobuf/internal/descriptor_database_test.py
View file @
dbea00ae
...
@@ -34,7 +34,10 @@
...
@@ -34,7 +34,10 @@
__author__
=
'matthewtoia@google.com (Matt Toia)'
__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
import
descriptor_pb2
from
google.protobuf.internal
import
factory_test2_pb2
from
google.protobuf.internal
import
factory_test2_pb2
from
google.protobuf
import
descriptor_database
from
google.protobuf
import
descriptor_database
...
...
python/google/protobuf/internal/descriptor_pool_test.py
View file @
dbea00ae
...
@@ -36,7 +36,10 @@ __author__ = 'matthewtoia@google.com (Matt Toia)'
...
@@ -36,7 +36,10 @@ __author__ = 'matthewtoia@google.com (Matt Toia)'
import
os
import
os
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
descriptor_pb2
from
google.protobuf
import
descriptor_pb2
from
google.protobuf.internal
import
api_implementation
from
google.protobuf.internal
import
api_implementation
...
...
python/google/protobuf/internal/descriptor_test.py
View file @
dbea00ae
...
@@ -36,7 +36,10 @@ __author__ = 'robinson@google.com (Will Robinson)'
...
@@ -36,7 +36,10 @@ __author__ = 'robinson@google.com (Will Robinson)'
import
sys
import
sys
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf
import
unittest_custom_options_pb2
from
google.protobuf
import
unittest_custom_options_pb2
from
google.protobuf
import
unittest_import_pb2
from
google.protobuf
import
unittest_import_pb2
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
unittest_pb2
...
@@ -391,7 +394,7 @@ class DescriptorTest(unittest.TestCase):
...
@@ -391,7 +394,7 @@ class DescriptorTest(unittest.TestCase):
self
.
assertEqual
(
self
.
my_file
.
name
,
'some/filename/some.proto'
)
self
.
assertEqual
(
self
.
my_file
.
name
,
'some/filename/some.proto'
)
self
.
assertEqual
(
self
.
my_file
.
package
,
'protobuf_unittest'
)
self
.
assertEqual
(
self
.
my_file
.
package
,
'protobuf_unittest'
)
@
test_util
.skipIf
(
@
unittest
.skipIf
(
api_implementation
.
Type
()
!=
'cpp'
or
api_implementation
.
Version
()
!=
2
,
api_implementation
.
Type
()
!=
'cpp'
or
api_implementation
.
Version
()
!=
2
,
'Immutability of descriptors is only enforced in v2 implementation'
)
'Immutability of descriptors is only enforced in v2 implementation'
)
def
testImmutableCppDescriptor
(
self
):
def
testImmutableCppDescriptor
(
self
):
...
...
python/google/protobuf/internal/generator_test.py
View file @
dbea00ae
...
@@ -41,7 +41,10 @@ further ensures that we can use Python protocol message objects as we expect.
...
@@ -41,7 +41,10 @@ further ensures that we can use Python protocol message objects as we expect.
__author__
=
'robinson@google.com (Will Robinson)'
__author__
=
'robinson@google.com (Will Robinson)'
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf.internal
import
test_bad_identifiers_pb2
from
google.protobuf.internal
import
test_bad_identifiers_pb2
from
google.protobuf
import
unittest_custom_options_pb2
from
google.protobuf
import
unittest_custom_options_pb2
from
google.protobuf
import
unittest_import_pb2
from
google.protobuf
import
unittest_import_pb2
...
...
python/google/protobuf/internal/json_format_test.py
View file @
dbea00ae
...
@@ -38,7 +38,10 @@ import json
...
@@ -38,7 +38,10 @@ import json
import
math
import
math
import
sys
import
sys
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf
import
json_format
from
google.protobuf
import
json_format
from
google.protobuf.util
import
json_format_proto3_pb2
from
google.protobuf.util
import
json_format_proto3_pb2
...
...
python/google/protobuf/internal/message_factory_test.py
View file @
dbea00ae
...
@@ -34,7 +34,10 @@
...
@@ -34,7 +34,10 @@
__author__
=
'matthewtoia@google.com (Matt Toia)'
__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
import
descriptor_pb2
from
google.protobuf.internal
import
factory_test1_pb2
from
google.protobuf.internal
import
factory_test1_pb2
from
google.protobuf.internal
import
factory_test2_pb2
from
google.protobuf.internal
import
factory_test2_pb2
...
...
python/google/protobuf/internal/message_test.py
View file @
dbea00ae
...
@@ -52,7 +52,10 @@ import pickle
...
@@ -52,7 +52,10 @@ import pickle
import
six
import
six
import
sys
import
sys
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf.internal
import
_parameterized
from
google.protobuf.internal
import
_parameterized
from
google.protobuf
import
map_unittest_pb2
from
google.protobuf
import
map_unittest_pb2
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
unittest_pb2
...
...
python/google/protobuf/internal/proto_builder_test.py
View file @
dbea00ae
...
@@ -37,7 +37,10 @@ try:
...
@@ -37,7 +37,10 @@ try:
except
ImportError
:
except
ImportError
:
from
ordereddict
import
OrderedDict
#PY26
from
ordereddict
import
OrderedDict
#PY26
import
collections
import
collections
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf
import
descriptor_pb2
from
google.protobuf
import
descriptor_pb2
from
google.protobuf
import
descriptor_pool
from
google.protobuf
import
descriptor_pool
from
google.protobuf
import
proto_builder
from
google.protobuf
import
proto_builder
...
...
python/google/protobuf/internal/reflection_test.py
View file @
dbea00ae
...
@@ -41,7 +41,10 @@ import operator
...
@@ -41,7 +41,10 @@ import operator
import
six
import
six
import
struct
import
struct
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf
import
unittest_import_pb2
from
google.protobuf
import
unittest_import_pb2
from
google.protobuf
import
unittest_mset_pb2
from
google.protobuf
import
unittest_mset_pb2
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
unittest_pb2
...
@@ -1623,7 +1626,7 @@ class ReflectionTest(unittest.TestCase):
...
@@ -1623,7 +1626,7 @@ class ReflectionTest(unittest.TestCase):
self
.
assertFalse
(
proto
.
IsInitialized
(
errors
))
self
.
assertFalse
(
proto
.
IsInitialized
(
errors
))
self
.
assertEqual
(
errors
,
[
'a'
,
'b'
,
'c'
])
self
.
assertEqual
(
errors
,
[
'a'
,
'b'
,
'c'
])
@
test_util
.skipIf
(
@
unittest
.skipIf
(
api_implementation
.
Type
()
!=
'cpp'
or
api_implementation
.
Version
()
!=
2
,
api_implementation
.
Type
()
!=
'cpp'
or
api_implementation
.
Version
()
!=
2
,
'Errors are only available from the most recent C++ implementation.'
)
'Errors are only available from the most recent C++ implementation.'
)
def
testFileDescriptorErrors
(
self
):
def
testFileDescriptorErrors
(
self
):
...
@@ -2822,7 +2825,7 @@ class OptionsTest(unittest.TestCase):
...
@@ -2822,7 +2825,7 @@ class OptionsTest(unittest.TestCase):
class
ClassAPITest
(
unittest
.
TestCase
):
class
ClassAPITest
(
unittest
.
TestCase
):
@
test_util
.skipIf
(
@
unittest
.skipIf
(
api_implementation
.
Type
()
==
'cpp'
and
api_implementation
.
Version
()
==
2
,
api_implementation
.
Type
()
==
'cpp'
and
api_implementation
.
Version
()
==
2
,
'C++ implementation requires a call to MakeDescriptor()'
)
'C++ implementation requires a call to MakeDescriptor()'
)
def
testMakeClassWithNestedDescriptor
(
self
):
def
testMakeClassWithNestedDescriptor
(
self
):
...
...
python/google/protobuf/internal/service_reflection_test.py
View file @
dbea00ae
...
@@ -34,7 +34,10 @@
...
@@ -34,7 +34,10 @@
__author__
=
'petar@google.com (Petar Petrov)'
__author__
=
'petar@google.com (Petar Petrov)'
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
service_reflection
from
google.protobuf
import
service_reflection
from
google.protobuf
import
service
from
google.protobuf
import
service
...
...
python/google/protobuf/internal/symbol_database_test.py
View file @
dbea00ae
...
@@ -32,7 +32,10 @@
...
@@ -32,7 +32,10 @@
"""Tests for google.protobuf.symbol_database."""
"""Tests for google.protobuf.symbol_database."""
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
descriptor
from
google.protobuf
import
descriptor
from
google.protobuf
import
symbol_database
from
google.protobuf
import
symbol_database
...
...
python/google/protobuf/internal/test_util.py
View file @
dbea00ae
...
@@ -38,13 +38,6 @@ __author__ = 'robinson@google.com (Will Robinson)'
...
@@ -38,13 +38,6 @@ __author__ = 'robinson@google.com (Will Robinson)'
import
os.path
import
os.path
import
sys
# PY2.6 compatible skipIf
if
sys
.
version_info
<
(
2
,
7
):
from
unittest2
import
skipIf
else
:
from
unittest
import
skipIf
from
google.protobuf
import
unittest_import_pb2
from
google.protobuf
import
unittest_import_pb2
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
descriptor_pb2
from
google.protobuf
import
descriptor_pb2
...
...
python/google/protobuf/internal/text_encoding_test.py
View file @
dbea00ae
...
@@ -32,7 +32,10 @@
...
@@ -32,7 +32,10 @@
"""Tests for google.protobuf.text_encoding."""
"""Tests for google.protobuf.text_encoding."""
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf
import
text_encoding
from
google.protobuf
import
text_encoding
TEST_VALUES
=
[
TEST_VALUES
=
[
...
...
python/google/protobuf/internal/text_format_test.py
View file @
dbea00ae
...
@@ -39,7 +39,10 @@ import re
...
@@ -39,7 +39,10 @@ import re
import
six
import
six
import
string
import
string
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf.internal
import
_parameterized
from
google.protobuf.internal
import
_parameterized
from
google.protobuf
import
map_unittest_pb2
from
google.protobuf
import
map_unittest_pb2
...
...
python/google/protobuf/internal/unknown_fields_test.py
View file @
dbea00ae
...
@@ -35,7 +35,10 @@
...
@@ -35,7 +35,10 @@
__author__
=
'bohdank@google.com (Bohdan Koval)'
__author__
=
'bohdank@google.com (Bohdan Koval)'
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf
import
unittest_mset_pb2
from
google.protobuf
import
unittest_mset_pb2
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
unittest_pb2
from
google.protobuf
import
unittest_proto3_arena_pb2
from
google.protobuf
import
unittest_proto3_arena_pb2
...
@@ -48,7 +51,7 @@ from google.protobuf.internal import type_checkers
...
@@ -48,7 +51,7 @@ from google.protobuf.internal import type_checkers
def
SkipIfCppImplementation
(
func
):
def
SkipIfCppImplementation
(
func
):
return
test_util
.
skipIf
(
return
unittest
.
skipIf
(
api_implementation
.
Type
()
==
'cpp'
and
api_implementation
.
Version
()
==
2
,
api_implementation
.
Type
()
==
'cpp'
and
api_implementation
.
Version
()
==
2
,
'C++ implementation does not expose unknown fields to Python'
)(
func
)
'C++ implementation does not expose unknown fields to Python'
)(
func
)
...
...
python/google/protobuf/internal/wire_format_test.py
View file @
dbea00ae
...
@@ -34,7 +34,10 @@
...
@@ -34,7 +34,10 @@
__author__
=
'robinson@google.com (Will Robinson)'
__author__
=
'robinson@google.com (Will Robinson)'
import
unittest
try
:
import
unittest2
as
unittest
except
ImportError
:
import
unittest
from
google.protobuf
import
message
from
google.protobuf
import
message
from
google.protobuf.internal
import
wire_format
from
google.protobuf.internal
import
wire_format
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment