Compare commits

...

9 Commits

Author SHA1 Message Date
boukeversteegh
0c02d1b21a Update with master 2020-07-04 18:54:26 +02:00
Bouke Versteegh
ac32bcd25a
Merge branch 'master' into michael-sayapin/master 2020-07-04 11:23:42 +02:00
boukeversteegh
72855227bd Fix import 2020-06-25 15:52:43 +02:00
boukeversteegh
47081617c2 Merge branch 'master' into michael-sayapin/master 2020-06-25 15:02:50 +02:00
boukeversteegh
d734206fe5 Rename test-case to keep it close with other enum test 2020-06-24 21:55:31 +02:00
Bouke Versteegh
bbf40f9694 Mark test xfail 2020-06-24 21:48:26 +02:00
Michael Sayapin
6671d87cef Conformance formatting 2020-06-17 11:37:36 +08:00
Michael Sayapin
cd66b0511a Fixes enum class name 2020-06-15 13:52:58 +08:00
Michael Sayapin
c48ca2e386 Test to_dict with missing enum values 2020-06-15 12:51:51 +08:00
3 changed files with 32 additions and 1 deletions

View File

@ -6,7 +6,8 @@ xfail = {
"namespace_keywords", # 70 "namespace_keywords", # 70
"namespace_builtin_types", # 53 "namespace_builtin_types", # 53
"googletypes_struct", # 9 "googletypes_struct", # 9
"googletypes_value", # 9, "googletypes_value", # 9
"enum_skipped_value", # 93
"import_capitalized_package", "import_capitalized_package",
"example", # This is the example in the readme. Not a test. "example", # This is the example in the readme. Not a test.
} }

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.enum_skipped_value 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'"