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
fae38169
Commit
fae38169
authored
Aug 07, 2017
by
Jie Luo
Committed by
GitHub
Aug 07, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3454 from anandolee/master
Add python 2.6 test back for cpp implementation.
parents
d08c291a
f5817b30
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
8 deletions
+16
-8
message_factory_test.py
python/google/protobuf/internal/message_factory_test.py
+8
-1
message_test.py
python/google/protobuf/internal/message_test.py
+3
-2
reflection_test.py
python/google/protobuf/internal/reflection_test.py
+4
-3
tests.sh
tests.sh
+1
-2
No files found.
python/google/protobuf/internal/message_factory_test.py
View file @
fae38169
...
@@ -183,7 +183,14 @@ class MessageFactoryTest(unittest.TestCase):
...
@@ -183,7 +183,14 @@ class MessageFactoryTest(unittest.TestCase):
with
self
.
assertRaises
(
Exception
)
as
cm
:
with
self
.
assertRaises
(
Exception
)
as
cm
:
factory
.
GetMessages
([
f
.
name
])
factory
.
GetMessages
([
f
.
name
])
self
.
assertIsInstance
(
cm
.
exception
,
(
AssertionError
,
ValueError
))
self
.
assertIn
(
str
(
cm
.
exception
),
[
'Extensions '
'"google.protobuf.python.internal.Duplicate.extension_field" and'
' "google.protobuf.python.internal.Extension.extension_field"'
' both try to extend message type'
' "google.protobuf.python.internal.Container"'
' with field number 2.'
,
'Double registration of Extensions'
])
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
python/google/protobuf/internal/message_test.py
View file @
fae38169
...
@@ -1832,8 +1832,9 @@ class PackedFieldTest(BaseTestCase):
...
@@ -1832,8 +1832,9 @@ class PackedFieldTest(BaseTestCase):
self
.
assertEqual
(
golden_data
,
message
.
SerializeToString
())
self
.
assertEqual
(
golden_data
,
message
.
SerializeToString
())
@unittest.skipIf
(
api_implementation
.
Type
()
!=
'cpp'
,
@unittest.skipIf
(
api_implementation
.
Type
()
!=
'cpp'
or
'explicit tests of the C++ implementation'
)
sys
.
version_info
<
(
2
,
7
),
'explicit tests of the C++ implementation for PY27 and above'
)
class
OversizeProtosTest
(
BaseTestCase
):
class
OversizeProtosTest
(
BaseTestCase
):
@classmethod
@classmethod
...
...
python/google/protobuf/internal/reflection_test.py
View file @
fae38169
...
@@ -40,6 +40,7 @@ import gc
...
@@ -40,6 +40,7 @@ import gc
import
operator
import
operator
import
six
import
six
import
struct
import
struct
import
sys
try
:
try
:
import
unittest2
as
unittest
#PY26
import
unittest2
as
unittest
#PY26
...
@@ -686,8 +687,8 @@ class ReflectionTest(BaseTestCase):
...
@@ -686,8 +687,8 @@ class ReflectionTest(BaseTestCase):
self
.
assertEqual
(
expected_min
,
getattr
(
pb
,
field_name
))
self
.
assertEqual
(
expected_min
,
getattr
(
pb
,
field_name
))
setattr
(
pb
,
field_name
,
expected_max
)
setattr
(
pb
,
field_name
,
expected_max
)
self
.
assertEqual
(
expected_max
,
getattr
(
pb
,
field_name
))
self
.
assertEqual
(
expected_max
,
getattr
(
pb
,
field_name
))
self
.
assertRaises
(
ValueError
,
setattr
,
pb
,
field_name
,
expected_min
-
1
)
self
.
assertRaises
(
Exception
,
setattr
,
pb
,
field_name
,
expected_min
-
1
)
self
.
assertRaises
(
ValueError
,
setattr
,
pb
,
field_name
,
expected_max
+
1
)
self
.
assertRaises
(
Exception
,
setattr
,
pb
,
field_name
,
expected_max
+
1
)
TestMinAndMaxIntegers
(
'optional_int32'
,
-
(
1
<<
31
),
(
1
<<
31
)
-
1
)
TestMinAndMaxIntegers
(
'optional_int32'
,
-
(
1
<<
31
),
(
1
<<
31
)
-
1
)
TestMinAndMaxIntegers
(
'optional_uint32'
,
0
,
0xffffffff
)
TestMinAndMaxIntegers
(
'optional_uint32'
,
0
,
0xffffffff
)
...
@@ -696,7 +697,7 @@ class ReflectionTest(BaseTestCase):
...
@@ -696,7 +697,7 @@ class ReflectionTest(BaseTestCase):
# A bit of white-box testing since -1 is an int and not a long in C++ and
# A bit of white-box testing since -1 is an int and not a long in C++ and
# so goes down a different path.
# so goes down a different path.
pb
=
unittest_pb2
.
TestAllTypes
()
pb
=
unittest_pb2
.
TestAllTypes
()
with
self
.
assertRaises
(
ValueError
):
with
self
.
assertRaises
(
Exception
):
pb
.
optional_uint64
=
integer_fn
(
-
(
1
<<
63
))
pb
.
optional_uint64
=
integer_fn
(
-
(
1
<<
63
))
pb
=
unittest_pb2
.
TestAllTypes
()
pb
=
unittest_pb2
.
TestAllTypes
()
...
...
tests.sh
View file @
fae38169
...
@@ -294,8 +294,7 @@ build_python_cpp() {
...
@@ -294,8 +294,7 @@ build_python_cpp() {
cd
python
cd
python
# Only test Python 2.6/3.x on Linux
# Only test Python 2.6/3.x on Linux
if
[
$(
uname
-s
)
==
"Linux"
]
;
then
if
[
$(
uname
-s
)
==
"Linux"
]
;
then
# py26 is currently disabled due to json_format
envlist
=
py
\{
26,27,33,34
\}
-cpp
envlist
=
py
\{
27,33,34
\}
-cpp
else
else
envlist
=
py27-cpp
envlist
=
py27-cpp
fi
fi
...
...
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