Test Service instantiation as part of standard test-case

This commit is contained in:
boukeversteegh
2020-05-24 20:02:41 +02:00
parent 20150fdcf3
commit ec5683e572
4 changed files with 14 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ import pytest
import betterproto
from betterproto.tests.inputs import xfail
from betterproto.tests.mocks import MockChannel
from betterproto.tests.util import get_directories, get_test_case_json_data, inputs_path
# Force pure-python implementation instead of C++, otherwise imports
@@ -113,6 +114,12 @@ def test_message_json(repeat, test_data: TestData) -> None:
assert json.loads(json_data) == json.loads(message_json)
@pytest.mark.parametrize("test_data", test_cases.services, indirect=True)
def test_service_can_be_instantiated(test_data: TestData) -> None:
plugin_module, _, json_data = test_data
plugin_module.TestStub(MockChannel())
@pytest.mark.parametrize("test_data", test_cases.messages_with_json, indirect=True)
def test_binary_compatibility(repeat, test_data: TestData) -> None:
plugin_module, reference_module, json_data = test_data