mirror of
				https://github.com/peeringdb/peeringdb.git
				synced 2024-05-11 05:55:09 +00:00 
			
		
		
		
	* stub in poetry for pipenv * re-add tester image * add pre-commit / formatting * fix ghactions * revert test data whitespace, exclude tests/data * revert ws * decruft, rm tox/pipenv * install dev packages for base image * add lgtm config to force to py3
		
			
				
	
	
		
			32 lines
		
	
	
		
			727 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			727 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| import os
 | |
| 
 | |
| import pytest
 | |
| import pytest_filedata
 | |
| 
 | |
| from peeringdb_server.inet import RdapLookup, RdapNotFoundError
 | |
| 
 | |
| pytest_filedata.setup(os.path.dirname(__file__))
 | |
| 
 | |
| 
 | |
| def pytest_generate_tests(metafunc):
 | |
|     for fixture in metafunc.fixturenames:
 | |
|         if fixture.startswith("data_"):
 | |
|             data = pytest_filedata.get_data(fixture)
 | |
|             metafunc.parametrize(fixture, list(data.values()), ids=list(data.keys()))
 | |
| 
 | |
| 
 | |
| @pytest.fixture
 | |
| def rdap():
 | |
|     return RdapLookup()
 | |
| 
 | |
| 
 | |
| @pytest.fixture
 | |
| def ixf_importer_user():
 | |
|     from django.contrib.auth import get_user_model
 | |
| 
 | |
|     user, created = get_user_model().objects.get_or_create(
 | |
|         username="ixf_importer",
 | |
|         email="ixf_importer@localhost",
 | |
|     )
 | |
|     return user
 |