Module Import alias Import alias Import alias Import alias Import alias Import alias Import alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str If UnaryOpNot CompareIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num NameLoad ImportFrom alias alias alias alias ImportFrom alias Import alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Assign NameStore AttributeLoad NameLoad attr Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Return BinOpMult NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr If CompareNotEq AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Return TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Call NameLoad Call NameLoad Expr Call AttributeLoad NameLoad attr handlers ExceptHandler body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr While CompareLt Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TupleLoad Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Return handlers ExceptHandler body Expr Call AttributeLoad NameLoad attr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareNotEq NameLoad Num body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareEq AttributeLoad NameLoad attr Num body Return TryExcept body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr Num decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str keyword Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Call NameLoad Num Call AttributeLoad AttributeLoad NameLoad attr attr Num decorator_list FunctionDef arguments args NameParam defaults body ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam defaults body For NameStore Call NameLoad AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareNotEq BinOpMult NameLoad Num NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list Assign NameStore ListLoad For NameStore Call NameLoad Num body Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword Num keyword BinOpMult NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Expr Call NameLoad Num Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad ListLoad Str Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str Assign AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Dict Str NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Expr Call NameLoad Str NameLoad Expr Call NameLoad Str NameLoad Expr Call NameLoad Str Num Expr Call NameLoad Str Num Expr Call NameLoad Str BinOpLShift Num Num Expr Call NameLoad Str BinOpLShift Num Num Expr Call NameLoad Str Num Expr Call NameLoad Str Str Expr Call NameLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad keyword Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign NameStore Call NameLoad keyword Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad ListLoad Num Num Num Num Num Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr ListComp Call NameLoad keyword NameLoad comprehension NameStore Call NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad ListComp TupleLoad NameLoad Call NameLoad keyword NameLoad comprehension NameStore Call NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Call NameLoad keyword Num NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Call NameLoad keyword Num NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Call NameLoad keyword Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call NameLoad keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad keyword ListLoad Str Str decorator_list decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr
N/A N/A logging N/A os N/A socket N/A sys N/A threading N/A time N/A unittest N/A LOG N/A N/A logging getLogger __name__ N/A gen_py_path N/A N/A N/A os path abspath N/A N/A N/A os path join N/A N/A N/A os path dirname __file__ gen-py N/A N/A N/A gen_py_path N/A sys path N/A N/A N/A N/A N/A sys path insert 1 gen_py_path djangothrift_test_gen.ttypes TestStruct TestNesting TestEnum TestManyTypes djangothrift_test_gen TestService N/A python_util N/A thrift_util thrift_util jsonable2thrift thrift2json thrift.protocol.TBinaryProtocol TBinaryProtocolFactory thrift.server TServer thrift.transport TSocket thrift.transport.TTransport TBufferedTransportFactory nose.tools assert_equal SimpleThriftServer N/A object N/A N/A socket_family N/A socket AF_INET N/A A simple thrift server impl __init__ N/A N/A self N/A N/A N/A N/A self port N/A N/A python_util find_unused_port N/A N/A self pid 0 N/A ping N/A N/A self in_val N/A N/A N/A N/A N/A logging info ping N/A N/A in_val 2 N/A start_server_process N/A N/A self N/A N/A N/A 
    Starts a test server, returns the (pid, port) pair.

    The server needs to be in a subprocess because we need to run a
    TThreadedServer for the concurrency tests. And the only way to stop a
    TThreadedServer is to kill it. So we can't just use a thread.
     N/A N/A self pid N/A N/A os fork N/A N/A N/A self pid 0 N/A N/A N/A N/A logging info N/A Started SimpleThriftServer (pid %s) on port %s N/A N/A self pid N/A self port N/A N/A N/A self _ensure_online N/A N/A N/A N/A processor N/A N/A TestService Processor self N/A transport N/A N/A TSocket TServerSocket localhost N/A self port socket_family N/A self socket_family N/A server N/A N/A TServer TThreadedServer processor transport N/A TBufferedTransportFactory N/A TBinaryProtocolFactory N/A N/A N/A server serve N/A N/A N/A N/A N/A N/A LOG exception failed to start thrift server N/A N/A N/A sys exit 1 N/A _ensure_online N/A N/A self N/A N/A N/A Ensure that the child server is online N/A deadline N/A N/A N/A time time 60 N/A N/A N/A logging debug N/A Socket Info:  N/A str N/A N/A socket getaddrinfo localhost N/A self port N/A socket AF_UNSPEC N/A socket SOCK_STREAM N/A N/A N/A N/A time time deadline N/A N/A N/A N/A logging info Waiting for service to come online N/A N/A N/A ping_s N/A N/A socket socket N/A self socket_family N/A socket SOCK_STREAM N/A N/A N/A ping_s connect N/A localhost N/A self port N/A N/A N/A ping_s close N/A N/A N/A N/A N/A N/A N/A LOG exception failed to connect to child server N/A N/A _ status N/A N/A os waitpid N/A self pid N/A os WNOHANG N/A N/A status 0 N/A N/A N/A N/A logging info N/A SimpleThriftServer child process exited with %s N/A status N/A N/A N/A time sleep 5 N/A N/A N/A logging info SimpleThriftServer took too long to come online N/A N/A N/A self stop_server_process N/A stop_server_process N/A N/A self N/A N/A N/A Stop the server N/A N/A N/A self pid 0 N/A N/A N/A N/A N/A N/A N/A logging info N/A Stopping SimpleThriftServer (pid %s) N/A N/A self pid N/A N/A N/A os kill N/A self pid 15 N/A N/A N/A Exception N/A ex N/A N/A N/A N/A logging exception (Potentially ok) Exception while stopping server N/A N/A N/A os waitpid N/A self pid 0 N/A N/A self pid 0 N/A N/A TestWithThriftServer N/A object N/A setup_class N/A N/A cls N/A N/A N/A N/A cls server N/A SimpleThriftServer N/A N/A N/A N/A cls server start_server_process N/A N/A cls client N/A N/A thrift_util get_client N/A TestService Client localhost N/A N/A cls server port Hue Unit Test Client timeout_seconds 1 N/A classmethod teardown_class N/A N/A cls N/A N/A N/A N/A N/A N/A cls server stop_server_process N/A classmethod test_basic_operation N/A N/A self N/A N/A N/A N/A assert_equal 10 N/A N/A N/A self client ping 5 N/A test_connection_race N/A N/A self N/A N/A Racer N/A N/A threading Thread N/A __init__ N/A N/A self client n_iter begin N/A N/A N/A N/A N/A N/A threading Thread __init__ self N/A N/A N/A self setName N/A Racer%s N/A begin N/A N/A self client client N/A N/A self n_iter n_iter N/A N/A self begin begin N/A N/A self errors N/A N/A run N/A N/A self N/A N/A N/A i N/A range N/A self begin N/A N/A self begin N/A self n_iter N/A N/A res N/A N/A N/A self client ping i N/A N/A N/A i 2 res N/A N/A N/A N/A N/A self errors append i N/A N/A N/A racers N/A N/A i N/A range 10 N/A N/A racer N/A Racer N/A self client n_iter 30 begin N/A i 100 N/A N/A N/A racers append racer N/A N/A N/A racer start N/A racer racers N/A N/A N/A N/A racer join N/A N/A assert_equal 0 N/A len N/A racer errors N/A N/A ThriftUtilTest N/A N/A unittest TestCase N/A test_simpler_string N/A N/A self N/A N/A N/A struct N/A TestStruct N/A N/A N/A self assertEquals TestStruct() N/A N/A thrift_util simpler_string struct N/A N/A struct a hello world N/A N/A N/A self assertEquals TestStruct(a='hello world') N/A N/A thrift_util simpler_string struct N/A N/A struct a N/A N/A struct b 12345 N/A N/A N/A self assertEquals TestStruct(a='', b=12345) N/A N/A thrift_util simpler_string struct N/A N/A struct a None N/A N/A N/A self assertEquals TestStruct(b=12345) N/A N/A thrift_util simpler_string struct N/A nested N/A TestNesting N/A N/A nested nested_struct struct N/A N/A N/A self assertEquals TestNesting(nested_struct=TestStruct(b=12345)) N/A N/A thrift_util simpler_string nested N/A test_to_from_bytes N/A N/A self N/A N/A N/A struct N/A TestStruct N/A N/A struct a hello world N/A N/A struct b 12345 N/A N/A N/A self assertEquals struct N/A N/A thrift_util from_bytes TestStruct N/A N/A thrift_util to_bytes struct N/A N/A N/A self assertEquals N/A N/A thrift_util to_bytes struct N/A N/A thrift_util to_bytes N/A N/A thrift_util from_bytes TestStruct N/A N/A thrift_util to_bytes struct N/A test_empty_string_vs_none N/A N/A self N/A N/A N/A struct1 N/A TestStruct N/A struct2 N/A TestStruct N/A N/A struct2 a N/A N/A N/A self assertNotEquals N/A N/A thrift_util to_bytes struct1 N/A N/A thrift_util to_bytes struct2 N/A N/A N/A self assertNotEquals struct1 struct2 N/A test_enum_as_sequence N/A N/A self N/A N/A N/A seq N/A N/A thrift_util enum_as_sequence TestEnum N/A N/A N/A self assertEquals N/A len seq 3 N/A N/A N/A self assertEquals N/A sorted seq N/A sorted N/A ENUM_ONE ENUM_TWO ENUM_THREE N/A test_is_thrift_struct N/A N/A self N/A N/A N/A N/A N/A self assertTrue N/A N/A thrift_util is_thrift_struct N/A TestStruct N/A N/A N/A self assertFalse N/A N/A thrift_util is_thrift_struct a string N/A test_fixup_enums N/A N/A self N/A N/A N/A enum N/A TestEnum N/A struct1 N/A TestStruct N/A N/A N/A self assertTrue N/A hasattr enum _VALUES_TO_NAMES N/A N/A struct1 myenum 0 N/A N/A N/A thrift_util fixup_enums struct1 N/A myenum TestEnum N/A N/A N/A self assertTrue N/A hasattr struct1 myenumAsString N/A N/A N/A self assertEquals N/A struct1 myenumAsString ENUM_ONE N/A N/A TestJsonable2Thrift N/A N/A unittest TestCase N/A N/A 
  Tests a handful of permutations of jsonable2thrift.
   assertBackAndForth N/A N/A self obj N/A N/A N/A 
    Checks that conversion to json and back is idempotent.
     N/A jsonable N/A thrift2json obj N/A back N/A jsonable2thrift jsonable N/A type obj N/A N/A N/A self assertEquals obj back N/A test_basic_types N/A N/A self N/A N/A help N/A N/A key value expect_failure N/A False N/A N/A x N/A TestManyTypes N/A N/A setattr x key value N/A N/A N/A self assertBackAndForth x N/A N/A N/A help a_bool True N/A N/A help a_bool False N/A N/A help a_byte 123 N/A N/A help a_i16 1234 N/A N/A help a_i32 N/A 1 30 N/A N/A help a_i64 N/A 1 62 N/A N/A help a_double 3.1415 N/A N/A help a_string hello there N/A N/A help a_binary bye bye N/A test_default N/A N/A self N/A N/A N/A x N/A jsonable2thrift N/A dict TestManyTypes N/A N/A N/A self assertEquals N/A TestManyTypes a_string_with_default the_default x N/A test_struct N/A N/A self N/A N/A N/A x N/A TestManyTypes N/A inner N/A TestStruct a foo N/A N/A x a_struct inner N/A N/A N/A self assertBackAndForth x N/A test_set N/A N/A self N/A N/A N/A x N/A TestManyTypes N/A N/A x a_set N/A set N/A 1 2 3 4 5 N/A N/A N/A self assertBackAndForth x N/A test_list N/A N/A self N/A N/A N/A x N/A TestManyTypes N/A N/A x a_list N/A N/A TestStruct b i N/A i N/A range 4 N/A N/A N/A self assertBackAndForth x N/A test_map N/A N/A self N/A N/A N/A x N/A TestManyTypes N/A N/A x a_map N/A dict N/A N/A i N/A TestStruct b i N/A i N/A range 4 N/A N/A N/A self assertBackAndForth x N/A test_limits N/A N/A self N/A N/A N/A 
    Checks that bound checking works.
     N/A N/A N/A self assertRaises AssertionError jsonable2thrift N/A dict a_byte 128 TestManyTypes N/A N/A N/A self assertRaises AssertionError jsonable2thrift N/A dict a_byte -129 TestManyTypes N/A N/A N/A self assertRaises AssertionError jsonable2thrift N/A dict a_byte not_a_number TestManyTypes N/A test_list_of_strings N/A N/A self N/A N/A N/A 
    Tests unicode and non-unicode strings.

    (This test arose as a bug.)
     N/A N/A N/A self assertBackAndForth N/A TestManyTypes a_string_list N/A alpha beta N/A N/A N/A self assertBackAndForth N/A TestManyTypes a_string_list N/A alpha beta N/A N/A N/A N/A __name__ __main__ N/A N/A N/A N/A unittest main