2018-11-08 19:45:21 +00:00
|
|
|
import os
|
|
|
|
|
import pytest
|
2019-02-22 22:23:09 +00:00
|
|
|
import pytest_filedata
|
2018-11-08 19:45:21 +00:00
|
|
|
|
2020-01-08 13:29:58 -06:00
|
|
|
from . import django_init
|
2018-11-08 19:45:21 +00:00
|
|
|
from peeringdb_server.inet import RdapLookup, RdapNotFoundError
|
|
|
|
|
|
2019-02-22 22:23:09 +00:00
|
|
|
|
|
|
|
|
pytest_filedata.setup(os.path.dirname(__file__))
|
2018-11-08 19:45:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def pytest_generate_tests(metafunc):
|
|
|
|
|
for fixture in metafunc.fixturenames:
|
2019-12-05 16:57:52 +00:00
|
|
|
if fixture.startswith("data_"):
|
2019-02-22 22:23:09 +00:00
|
|
|
data = pytest_filedata.get_data(fixture)
|
|
|
|
|
metafunc.parametrize(fixture, list(data.values()), ids=list(data.keys()))
|
2018-11-08 19:45:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
|
def rdap():
|
|
|
|
|
return RdapLookup()
|