mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
initial commit of code
This commit is contained in:
17
tests/test_inet_parse.py
Normal file
17
tests/test_inet_parse.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from peeringdb_server.inet import RdapAsn
|
||||
import pytest
|
||||
|
||||
|
||||
def assert_parsed(data, parsed):
|
||||
# dump in json format for easily adding expected
|
||||
print("echo \\\n'{}'\\\n > {}/{}.expected".format(
|
||||
data.dumps(parsed), data.path, data.name))
|
||||
assert data.expected == parsed
|
||||
|
||||
|
||||
@pytest.RequestsData("rdap", real_http=True)
|
||||
def test_rdap_asn_lookup(rdap, data_rdap_autnum):
|
||||
print(data_rdap_autnum.name)
|
||||
#asn = rdap.get_asn(205726)
|
||||
asn = rdap.get_asn(data_rdap_autnum.name)
|
||||
assert_parsed(data_rdap_autnum, asn.parsed())
|
||||
Reference in New Issue
Block a user