def test_unsigned_hex_to_signed_int_with_number(): assert thrift_helper.unsigned_hex_to_signed_int('17133d482ba4f605') == \ 1662740067609015813 assert thrift_helper.unsigned_hex_to_signed_int('b6dbb1c2b362bf51') == \ -5270423489115668655 # Test for backwards compatibility with previous versions of this library # This tests the case where a service is running pyramid_zipkin<=0.8.1 and # receives a signed hex string parent_span_id that has the format # '0xDEADBEEF' or '-0xDEADBEEF' assert thrift_helper.unsigned_hex_to_signed_int('0x4f18a03ad0031fe9') == \ 5699481502895775721 assert thrift_helper.unsigned_hex_to_signed_int('-0x4f18a03ad0031fe9') == \ -5699481502895775721
def validate_span(span_obj): result_span = test_helper.massage_result_span(span_obj) timestamps = test_helper.get_timestamps(result_span) get_span["trace_id"] = unsigned_hex_to_signed_int(default_trace_id_generator(span_obj)) assert get_span == result_span assert old_time <= timestamps["sr"] assert timestamps["sr"] <= timestamps["ss"]