Working test case for oneof
This commit is contained in:
parent
5b6997870a
commit
659ddd9c44
@ -1,3 +1,3 @@
|
||||
{
|
||||
"name": "foo"
|
||||
"name": "foobar"
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"count": 1
|
||||
"count": 100
|
||||
}
|
||||
|
15
betterproto/tests/inputs/oneof/test_oneof.py
Normal file
15
betterproto/tests/inputs/oneof/test_oneof.py
Normal file
@ -0,0 +1,15 @@
|
||||
import betterproto
|
||||
from betterproto.tests.output_betterproto.oneof.oneof import Test
|
||||
from betterproto.tests.util import get_test_case_json_data
|
||||
|
||||
|
||||
def test_which_count():
|
||||
message = Test()
|
||||
message.from_json(get_test_case_json_data("oneof"))
|
||||
assert betterproto.which_one_of(message, "foo") == ("count", 100)
|
||||
|
||||
|
||||
def test_which_name():
|
||||
message = Test()
|
||||
message.from_json(get_test_case_json_data("oneof", "oneof-name.json"))
|
||||
assert betterproto.which_one_of(message, "foo") == ("name", "foobar")
|
Loading…
x
Reference in New Issue
Block a user