Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Commit 3ad084f

Browse files
committed
add test for creating TPayload instances using positional args
1 parent 6c852ba commit 3ad084f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_type.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,13 @@ def test_mutable_default_set():
4949

5050
s2 = Struct()
5151
assert s2.tset == set()
52+
53+
54+
def test_positional_args():
55+
# thriftpy instantiates TPayload objects using positional args.
56+
# thriftpy.thrift.TException being the most notable example.
57+
# make sure that we don't break backwards compatiblity
58+
s1 = Struct({1: 2}, set([3, 4]), [5, 6])
59+
assert s1.tdict == {1: 2}
60+
assert s1.tset == set([3, 4])
61+
assert s1.tlist == [5, 6]

0 commit comments

Comments
 (0)