From f975741a25132eaac7a8da35abd55e64752a7378 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Mon, 5 Nov 2018 14:33:40 -0500 Subject: [PATCH] Add explicit skips for unimplemented transform testprotos. --- firestore/tests/unit/test_cross_language.py | 32 ++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/firestore/tests/unit/test_cross_language.py b/firestore/tests/unit/test_cross_language.py index 2cc26bc27802..bcbd941f6850 100644 --- a/firestore/tests/unit/test_cross_language.py +++ b/firestore/tests/unit/test_cross_language.py @@ -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', @@ -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'] @@ -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.