diff --git a/swh/lister/pypi/tests/api_response.html b/swh/lister/pypi/tests/api_response.html
new file mode 100644
--- /dev/null
+++ b/swh/lister/pypi/tests/api_response.html
@@ -0,0 +1,12 @@
+
+
+
+ Simple index
+
+
+ 0lever-so
+ 0lever-utils
+ 0-orchestrator
+ 0wned
+
+
\ No newline at end of file
diff --git a/swh/lister/pypi/tests/test_lister.py b/swh/lister/pypi/tests/test_lister.py
new file mode 100644
--- /dev/null
+++ b/swh/lister/pypi/tests/test_lister.py
@@ -0,0 +1,55 @@
+# Copyright (C) 2019 the Software Heritage developers
+# License: GNU General Public License version 3, or any later version
+# See top-level LICENSE file for more information
+
+from swh.lister.pypi.lister import PyPILister
+from unittest.mock import patch
+import requests_mock
+import requests
+
+lister = PyPILister()
+
+expected_packages = ['0lever-so', '0lever-utils', '0-orchestrator', '0wned']
+
+expected_model = {
+ 'uid': 'arrow',
+ 'name': 'arrow',
+ 'full_name': 'arrow',
+ 'html_url': 'https://pypi.org/pypi/arrow/json',
+ 'origin_url': 'https://pypi.org/project/arrow/',
+ 'origin_type': 'pypi',
+ }
+
+
+def test_list_packages():
+ f = open('swh/lister/pypi/tests/api_response.html')
+ api_response = f.read()
+
+ adapter = requests_mock.Adapter()
+ session = requests.Session()
+ session.mount('mock', adapter)
+
+ adapter.register_uri('GET', 'mock://test.com/path', text=api_response)
+ response = session.get('mock://test.com/path')
+
+ packages = lister.list_packages(response)
+ assert len(packages) == 4
+ for package in expected_packages:
+ assert package in packages
+
+
+def test_transport_response_simplified():
+ model = lister.transport_response_simplified(['arrow'])
+ assert len(model) == 1
+ for key, values in model[0].items():
+ assert values == expected_model[key]
+
+
+def test_task_dict():
+ with patch('swh.lister.pypi.lister.utils.create_task_dict') \
+ as mock_create_tasks:
+ lister.task_dict(origin_type='pypi', origin_url='https://abc',
+ name='test_pack', html_url='https://def')
+ mock_create_tasks.assert_called_once_with(
+ 'load-pypi', 'recurring', 'test_pack', 'https://abc',
+ project_metadata_url='https://def')