Skip to content

Commit

Permalink
Add explicit skips for unimplemented transform testprotos.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Nov 5, 2018
1 parent 1d7ddc8 commit f975741
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions firestore/tests/unit/test_cross_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from google.cloud.firestore_v1beta1.proto import test_pb2
from google.cloud.firestore_v1beta1.proto import write_pb2

_MISSING_FEATURES = [
_UNIMPLEMENTED_FEATURES = [
# tests having to do with the ArrayUnion, ArrayRemove, and Delete
# transforms
'create-all-transforms.textproto',
Expand Down Expand Up @@ -82,38 +82,44 @@ def _load_testproto(filename):
return test_proto


_ALL_TESTPROTOS = [
_UNIMPLEMENTED_FEATURE_TESTPROTOS = [
_load_testproto(filename) for filename in sorted(
glob.glob('tests/unit/testdata/*.textproto'))
if not os.path.split(filename)[-1] in _MISSING_FEATURES
if os.path.split(filename)[-1] in _UNIMPLEMENTED_FEATURES
]

IMPLEMENTED_FEATURE_TESTPROTOS = [
_load_testproto(filename) for filename in sorted(
glob.glob('tests/unit/testdata/*.textproto'))
if not os.path.split(filename)[-1] in _UNIMPLEMENTED_FEATURES
]

_CREATE_TESTPROTOS = [
test_proto for test_proto in _ALL_TESTPROTOS
test_proto for test_proto in IMPLEMENTED_FEATURE_TESTPROTOS
if test_proto.WhichOneof('test') == 'create']

_GET_TESTPROTOS = [
test_proto for test_proto in _ALL_TESTPROTOS
test_proto for test_proto in IMPLEMENTED_FEATURE_TESTPROTOS
if test_proto.WhichOneof('test') == 'get']

_SET_TESTPROTOS = [
test_proto for test_proto in _ALL_TESTPROTOS
test_proto for test_proto in IMPLEMENTED_FEATURE_TESTPROTOS
if test_proto.WhichOneof('test') == 'set']

_UPDATE_TESTPROTOS = [
test_proto for test_proto in _ALL_TESTPROTOS
test_proto for test_proto in IMPLEMENTED_FEATURE_TESTPROTOS
if test_proto.WhichOneof('test') == 'update']

_UPDATE_PATHS_TESTPROTOS = [
test_proto for test_proto in _ALL_TESTPROTOS
test_proto for test_proto in IMPLEMENTED_FEATURE_TESTPROTOS
if test_proto.WhichOneof('test') == 'update_paths']

_DELETE_TESTPROTOS = [
test_proto for test_proto in _ALL_TESTPROTOS
test_proto for test_proto in IMPLEMENTED_FEATURE_TESTPROTOS
if test_proto.WhichOneof('test') == 'delete']

_LISTEN_TESTPROTOS = [
test_proto for test_proto in _ALL_TESTPROTOS
test_proto for test_proto in IMPLEMENTED_FEATURE_TESTPROTOS
if test_proto.WhichOneof('test') == 'listen']


Expand Down Expand Up @@ -236,6 +242,12 @@ def test_listen_paths_testprotos(test_proto):
pass


@pytest.mark.skip(reason="Feature not yet implemented in Python.")
@pytest.mark.parametrize('test_proto', _UNIMPLEMENTED_FEATURE_TESTPROTOS)
def test_unimplemented_features_testprotos(test_proto):
pass


def convert_data(v):
# Replace the strings 'ServerTimestamp' and 'Delete' with the corresponding
# sentinels.
Expand Down

0 comments on commit f975741

Please sign in to comment.