1
0
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:
Stefan Pratter
2018-11-08 19:45:21 +00:00
parent 5d7c69de38
commit 0edf47bbfb
370 changed files with 47054 additions and 16 deletions

17
tests/test_inet_parse.py Normal file
View 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())