示例#1
0
def test_build_uri_ip():

    valid = "https://api.dnsdb.info/lookup/rdata/ip/104.244.14.108?limit=50000"

    options = get_options()
    options["ip"] = "104.244.14.108"

    uri = utils.build_uri(options)
    assert uri == valid
示例#2
0
def test_build_uri_name_bailiwick():
    valid = "https://api.dnsdb.info/lookup/rrset/name/fsi.io/ANY/io.?limit" "=50000"

    options = get_options()
    options["name"] = "fsi.io"
    options["bailiwick"] = "io."

    options = utils.validate_options(options)
    uri = utils.build_uri(options)
    assert uri == valid
示例#3
0
def test_build_uri_hex():

    valid = "https://api.dnsdb.info/lookup/rdata/raw/36757a35?limit=50000"

    options = get_options()
    options["hex"] = "36757a35"

    options = utils.validate_options(options)
    uri = utils.build_uri(options)
    assert uri == valid
示例#4
0
def test_build_uri_name_time_first_before():
    valid = ("https://api.dnsdb.info/lookup/rrset/name/fsi.io/ANY?limit=50000"
             "&time_first_before=1540864340")

    options = get_options()
    options["name"] = "fsi.io"
    options["time_first_before"] = 1540864340

    options = utils.validate_options(options)
    uri = utils.build_uri(options)
    assert uri == valid
示例#5
0
def test_build_uri_name_remote_limit():

    valid = "https://api.dnsdb.info/lookup/rrset/name/fsi.io/ANY?limit=25000"

    options = get_options()
    options["name"] = "fsi.io"
    options["remote_limit"] = 25000

    options = utils.validate_options(options)
    uri = utils.build_uri(options)
    assert uri == valid
示例#6
0
def test_build_uri_name_inverse():

    valid = "https://api.dnsdb.info/lookup/rdata/name/fsi.io/ANY?limit=50000"

    options = get_options()
    options["name"] = "fsi.io"
    options["inverse"] = True

    options = utils.validate_options(options)
    uri = utils.build_uri(options)
    assert uri == valid
示例#7
0
def test_build_uri_name_wildcard_right():

    valid = "https://api.dnsdb.info/lookup/rrset/name/fsi.*/ANY?limit=50000"

    options = get_options()
    options["name"] = "fsi"
    options["wildcard_right"] = True

    options = utils.validate_options(options)
    uri = utils.build_uri(options)
    assert uri == valid
示例#8
0
def test_build_uri_name_type():

    valid = "https://api.dnsdb.info/lookup/rrset/name/fsi.io/A?limit=50000"

    options = get_options()
    options["name"] = "fsi.io"
    options["type"] = "A"

    options = utils.validate_options(options)
    uri = utils.build_uri(options)
    assert uri == valid
示例#9
0
def test_build_uri_name_type_inverse_wildcard_left():

    valid = "https://api.dnsdb.info/lookup/rdata/name/*.fsi.io/MX?limit=50000"

    options = get_options()
    options["name"] = "fsi.io"
    options["type"] = "MX"
    options["inverse"] = True
    options["wildcard_left"] = True

    options = utils.validate_options(options)
    uri = utils.build_uri(options)
    assert uri == valid