Rename test-case to keep it close with other enum test

This commit is contained in:
boukeversteegh
2020-06-24 21:55:31 +02:00
parent bbf40f9694
commit d734206fe5
3 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
message Test {
enum MyEnum {
ZERO = 0;
ONE = 1;
// TWO = 2;
THREE = 3;
FOUR = 4;
}
MyEnum x = 1;
}

View File

@@ -0,0 +1,18 @@
from betterproto.tests.output_betterproto.to_dict_with_missing_enum.to_dict_with_missing_enum import (
Test,
TestMyEnum,
)
import pytest
@pytest.mark.xfail(reason="#93")
def test_message_attributes():
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'"