Conformance formatting

This commit is contained in:
Michael Sayapin 2020-06-17 11:37:36 +08:00
parent cd66b0511a
commit 6671d87cef
2 changed files with 14 additions and 5 deletions

View File

@ -1,7 +1,16 @@
from betterproto.tests.output_betterproto.to_dict_with_missing_enum.to_dict_with_missing_enum import TestMessage, TestMessageMyEnum
from betterproto.tests.output_betterproto.to_dict_with_missing_enum.to_dict_with_missing_enum import (
Test,
TestMyEnum,
)
def test_message_attributes():
assert TestMessage(x=TestMessageMyEnum.ONE).to_dict()['x'] == "ONE", "MyEnum.ONE is not serialized to 'ONE'"
assert TestMessage(x=TestMessageMyEnum.THREE).to_dict()['x'] == "THREE", "MyEnum.THREE is not serialized to 'THREE'"
assert TestMessage(x=TestMessageMyEnum.FOUR).to_dict()['x'] == "FOUR", "MyEnum.FOUR is not serialized to 'FOUR'"
assert (
Test(x=TestMyEnum.ONE).to_dict()['x'] == "ONE"
), "MyEnum.ONE is not serialized to 'ONE'"
assert (
Test(x=TestMyEnum.THREE).to_dict()['x'] == "THREE"
), "MyEnum.THREE is not serialized to 'THREE'"
assert (
Test(x=TestMyEnum.FOUR).to_dict()['x'] == "FOUR"
), "MyEnum.FOUR is not serialized to 'FOUR'"

View File

@ -1,6 +1,6 @@
syntax = "proto3";
message TestMessage {
message Test {
enum MyEnum {
ZERO = 0;
ONE = 1;