File: instance_browser_client_test.py

package info (click to toggle)
pytds 1.16.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 868 kB
  • sloc: python: 12,831; makefile: 199; sh: 8
file content (16 lines) | stat: -rw-r--r-- 518 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pytds.instance_browser_client


def test_get_instances():
    data = b"\x05[\x00ServerName;MISHA-PC;InstanceName;SQLEXPRESS;IsClustered;No;Version;10.0.1600.22;tcp;49849;;"
    ref = {
        "SQLEXPRESS": {
            "ServerName": "MISHA-PC",
            "InstanceName": "SQLEXPRESS",
            "IsClustered": "No",
            "Version": "10.0.1600.22",
            "tcp": "49849",
        },
    }
    instances = pytds.instance_browser_client.parse_instances_response(data)
    assert instances == ref