Example #1
0
    def test_hash_connection_str_hostname(self):
        hostname = "ChaoyiTestIoT.azure-devices.net"

        assert Utils.hash_connection_str_hostname(hostname) == (
            '6b8fcfea09003d5f104771e83bd9ff54c592ec2277ec1815df91dd64d1633778', 'azure-devices.net')

        assert Utils.hash_connection_str_hostname("") == ("", "")
        assert Utils.hash_connection_str_hostname(None) == ("", "")
Example #2
0
    def test_hash_connection_str_hostname(self):
        connection_str = "HostName=ChaoyiTestIoT.azure-devices.net;DeviceId=edge-device;SharedAccessKey=foobarbazqux="

        assert Utils.hash_connection_str_hostname(connection_str) == (
            '6b8fcfea09003d5f104771e83bd9ff54c592ec2277ec1815df91dd64d1633778',
            'azure-devices.net')

        assert Utils.hash_connection_str_hostname("") == ("", "")
        assert Utils.hash_connection_str_hostname(None) == ("", "")