Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Protobuf 3.2.0 #82

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ sudo: false
cache:
directories:
- $HOME/.cache/pip
- /tmp/proto3.1.0
- /tmp/proto3.2.0

install:
- pip install pip --upgrade
@@ -21,8 +21,8 @@ before_script:
- pip install -r dev-requirements.txt -c constraints.txt

before_install:
- bash tools/travis-install-protoc.sh 3.1.0
- export PATH=/tmp/proto3.1.0/bin:$PATH
- bash tools/travis-install-protoc.sh 3.2.0
- export PATH=/tmp/proto3.2.0/bin:$PATH

# run_tests.py runs everything under the script: tag so only put commands
# under it that we want to run (and want to be able to run) as local tests
2 changes: 1 addition & 1 deletion constraints.txt
Original file line number Diff line number Diff line change
@@ -24,4 +24,4 @@
# ga4gh-schemas==0.1.0
#
#git+git://github.com/ga4gh/ga4gh-common.git@master#egg=ga4gh_common
#git+git://github.com/ga4gh/schemas.git@master#egg=ga4gh_schemas
git+git://github.com/ljdursi/ga4gh-schemas.git@protobuf_3.2.0#egg=ga4gh_schemas
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@
# These requirements are read directly into setup.py, so specify them
# in the order that they should be in in setup.py
ga4gh_common==0.0.7
ga4gh_schemas==0.6.0a10.post1
ga4gh_schemas
requests
protobuf==3.1.0.post1
protobuf==3.2.0
6 changes: 6 additions & 0 deletions tests/unit/fakeobj.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package fakeobj;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This


message FakeObject {
required string name = 1;
required string id = 2;
}
74 changes: 74 additions & 0 deletions tests/unit/fakeobj_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 3 additions & 48 deletions tests/unit/test_cli.py
Original file line number Diff line number Diff line change
@@ -9,13 +9,11 @@
import mock
import unittest

import google.protobuf.descriptor as descriptor
import google.protobuf.internal.python_message as python_message

import ga4gh.client.cli as cli_client

import ga4gh.common.utils as utils
import ga4gh.schemas.protocol as protocol

import tests.unit.fakeobj_pb2 as fakeobj


class TestClientArguments(unittest.TestCase):
@@ -427,51 +425,8 @@ def __init__(self, outputFormat='text'):
self.baseUrl = 'baseUrl'
self.verbose = 'verbose'

class FakeObject(protocol.message.Message):
__metaclass__ = python_message.GeneratedProtocolMessageType

FILE = descriptor.FileDescriptor(__file__, "test", "")
DESCRIPTOR = descriptor.Descriptor(
"FakeObject",
"test.FakeObject",
filename=__file__,
file=FILE,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name="name",
full_name="test.FakeObject.name",
index=0,
number=1,
type=descriptor.FieldDescriptor.TYPE_STRING,
cpp_type=descriptor.FieldDescriptor.CPPTYPE_STRING,
label=descriptor.FieldDescriptor.LABEL_REQUIRED,
default_value="",
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None
),
descriptor.FieldDescriptor(
name="id",
full_name="test.FakeObject.id",
index=1,
number=2,
type=descriptor.FieldDescriptor.TYPE_STRING,
cpp_type=descriptor.FieldDescriptor.CPPTYPE_STRING,
label=descriptor.FieldDescriptor.LABEL_REQUIRED,
default_value="",
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None
)
], nested_types=[], enum_types=[], extensions=[])

def makeFakeObject(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah - that's the same as https://github.com/ljdursi/ga4gh-client/blob/master/tests/unit/test_cli.py#L430 , but with the stricter C++ implementation it actually needs to be a .proto file that gets compiled into a _pb2.py .

returnObj = self.FakeObject()
returnObj = fakeobj.FakeObject()
returnObj.id = 'id'
returnObj.name = 'name'
return returnObj
2 changes: 1 addition & 1 deletion tests/unit/test_client.py
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ def testSearchVariantAnnotations(self):
reference_name=self.referenceName,
start=self.start,
end=self.end,
effects=[{"term": "just a term"}, {"term_id": "an id"}],
effects=[{b"term": b"just a term"}, {b"term_id": b"an id"}],
reference_id=self.referenceId)

def testSearchFeatures(self):