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

Commit

Permalink
add test for creating TPayload instances using positional args
Browse files Browse the repository at this point in the history
  • Loading branch information
mrterry committed Jan 28, 2017
1 parent 6c852ba commit b885cba
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ def test_mutable_default_set():

s2 = Struct()
assert s2.tset == set()


def test_positional_args():
# thriftpy instantiates TPayload objects using positional args.
# thriftpy.thrift.TException being the most notable example.
# make sure that we don't break backwards compatiblity
s1 = Struct({1: 2}, {3, 4}, [5, 6])
assert s1.tdict == {1, 2}
assert s1.tset == {3, 4}
assert s1.tlist == [5, 6]

0 comments on commit b885cba

Please sign in to comment.