def test_build_remote_repository_with_unknown_package(self, mock): from papaye.proxy import PyPiProxy mock.return_value = FakeGRequestResponse(404, b'') proxy = PyPiProxy() result = proxy.build_remote_repository('pyramid', metadata=True) assert result is None
def test_build_remote_repository_with_release_name(self, mock): from papaye.models import Root from papaye.proxy import PyPiProxy mock_proxy_response(mock) proxy = PyPiProxy() result = proxy.build_remote_repository('pyramid', release_name='1.5') assert isinstance(result, Root) assert 'pyramid' in list(result.keys()) assert len(list(result['pyramid'])) == 1
def test_build_remote_repository(self, mock): from papaye.models import Root from papaye.proxy import PyPiProxy mock_proxy_response(mock) proxy = PyPiProxy() result = proxy.build_remote_repository('pyramid') assert isinstance(result, Root) assert 'pyramid' in [e.__name__ for e in result] assert len(list(result['pyramid'])) == 81 assert not hasattr(list(result['pyramid'])[0], 'metadata')
def test_build_remote_repository_with_metadata(self, mock): from papaye.models import Root from papaye.proxy import PyPiProxy mock_proxy_response(mock) proxy = PyPiProxy() result = proxy.build_remote_repository('pyramid', metadata=True) assert isinstance(result, Root) assert 'pyramid' in list(result.keys()) assert len(list(result['pyramid'])) == 81 assert hasattr(list(result['pyramid'])[0], 'metadata') assert len(list(result['pyramid'])[0].metadata.keys()) == 13