mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
port to new pytest_filedata
This commit is contained in:
17
Pipfile
17
Pipfile
@@ -1,9 +1,12 @@
|
||||
[[source]]
|
||||
|
||||
name = "pypi"
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
|
||||
|
||||
[dev-packages]
|
||||
|
||||
pytest = ">=2.8.7"
|
||||
pytest-cov = ">=2.0.0"
|
||||
pytest-django = ">=2.9.1"
|
||||
@@ -11,7 +14,9 @@ pytest-filedata = ">=0.1.0"
|
||||
jsonschema = ">=2.6.0"
|
||||
facsimile = ">=1.1.1"
|
||||
|
||||
|
||||
[packages]
|
||||
|
||||
certifi = "==2017.11.5"
|
||||
ipaddress = "==1.0.19"
|
||||
mysqlclient = "==1.3.9"
|
||||
@@ -21,7 +26,7 @@ coreapi = "==2.3.1"
|
||||
googlemaps = "==2.5.1"
|
||||
django-allauth = "==0.32.0"
|
||||
django-autocomplete-light = "==3.2.9"
|
||||
django-bootstrap3 = "==9.0.0"
|
||||
"django-bootstrap3" = "==9.0.0"
|
||||
django-cors-middleware = "==1.3.1"
|
||||
django-countries = "==4.6.1"
|
||||
django-crispy-forms = "==1.6.1"
|
||||
@@ -35,7 +40,7 @@ django-phonenumber-field = "==0.6"
|
||||
django-reversion = "==2.0.9"
|
||||
django-rest-swagger = "==2.1.2"
|
||||
djangorestframework = "==3.6.3"
|
||||
django-tables2 = "==1.0.4"
|
||||
"django-tables2" = "==1.0.4"
|
||||
django-vanilla-views = "==1.0.2"
|
||||
django-cors-headers = "==2.1.0"
|
||||
django-ratelimit = "==1.1.0"
|
||||
@@ -47,10 +52,12 @@ django-namespace-perms = "==0.5.0"
|
||||
django-peeringdb = "==0.6.0"
|
||||
peeringdb = "==0.5.1"
|
||||
rdap = "==0.2.0"
|
||||
Django = "==1.11.20"
|
||||
uWSGI = "==2.0.14"
|
||||
Markdown = "==2.6.7"
|
||||
django = "==1.11.20"
|
||||
uwsgi = "==2.0.14"
|
||||
markdown = "==2.6.7"
|
||||
"twentyc.rpc" = "==0.3.5"
|
||||
|
||||
|
||||
[requires]
|
||||
|
||||
python_version = "2.7"
|
||||
|
||||
2
Pipfile.lock
generated
2
Pipfile.lock
generated
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "1380709c99d39c45b6d29a32414d97acd3056c23072d8be478f08bd637aa82e3"
|
||||
"sha256": "1a543a6defe8d52546fe6b3b8a59029d7655146aef013e0fa15a13ad8583dd4a"
|
||||
},
|
||||
"host-environment-markers": {
|
||||
"implementation_name": "cpython",
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
import os
|
||||
import pytest
|
||||
import pytest_filedata
|
||||
|
||||
import django_init
|
||||
from peeringdb_server.inet import RdapLookup, RdapNotFoundError
|
||||
|
||||
pytest.setup_filedata(os.path.dirname(__file__))
|
||||
|
||||
pytest_filedata.setup(os.path.dirname(__file__))
|
||||
|
||||
|
||||
def pytest_generate_tests(metafunc):
|
||||
for fixture in metafunc.fixturenames:
|
||||
if fixture.startswith('data_'):
|
||||
data = pytest.get_filedata(fixture)
|
||||
metafunc.parametrize(fixture, data.values(), ids=data.keys())
|
||||
data = pytest_filedata.get_data(fixture)
|
||||
metafunc.parametrize(fixture, list(data.values()), ids=list(data.keys()))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from peeringdb_server.inet import RdapLookup, RdapNotFoundError
|
||||
import pytest
|
||||
import pytest_filedata
|
||||
|
||||
|
||||
def test_rdap_asn_lookup(rdap):
|
||||
@@ -26,7 +27,7 @@ def test_mocker(rdap):
|
||||
asn = rdap.get_asn(63311)
|
||||
|
||||
|
||||
@pytest.RequestsData("rdap")
|
||||
@pytest_filedata.RequestsData("rdap")
|
||||
def test_arin0(rdap):
|
||||
asn = rdap.get_asn(63311)
|
||||
assert asn.emails == ['neteng@20c.com']
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from peeringdb_server.inet import RdapAsn
|
||||
import pytest
|
||||
import pytest_filedata
|
||||
|
||||
|
||||
def assert_parsed(data, parsed):
|
||||
@@ -9,7 +10,7 @@ def assert_parsed(data, parsed):
|
||||
assert data.expected == parsed
|
||||
|
||||
|
||||
@pytest.RequestsData("rdap", real_http=True)
|
||||
@pytest_filedata.RequestsData("rdap", real_http=True)
|
||||
def test_rdap_asn_lookup(rdap, data_rdap_autnum):
|
||||
print(data_rdap_autnum.name)
|
||||
#asn = rdap.get_asn(205726)
|
||||
|
||||
Reference in New Issue
Block a user