test_id_management.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:python-sensor 作者: instana 项目源码 文件源码
def test_id_to_header_conversion():
    # Test passing a standard Integer ID
    original_id = instana.util.generate_id()
    converted_id = instana.util.id_to_header(original_id)

    # Assert that it is a string and there are no non-hex characters
    assert isinstance(converted_id, string_types)
    assert all(c in string.hexdigits for c in converted_id)

    # Test passing a standard Integer ID as a String
    original_id = instana.util.generate_id()
    converted_id = instana.util.id_to_header(original_id)

    # Assert that it is a string and there are no non-hex characters
    assert isinstance(converted_id, string_types)
    assert all(c in string.hexdigits for c in converted_id)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号