Page MenuHomePhabricator

Add a testing infrastructure
Closed, ResolvedPublic

Description

This bug will serve for a general discussion about how to restructure the project so to add tests.

I suggest to adopt the following structure with a [[ https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure | src ]] directory:

oabot
├─ src
│  └─ oabot
│     ├─ __init__.py
│     ├─ ...
│     ├─ static
│     │  ├─  css
│     │  └─ js
│     └─ templates
├─ tests
│  └─ ...
├─ setup.py
└─ MANIFEST.in

note that the following structure is the one suggest for testing flask applications. In general, I would like to follow the same structure as flaskr (a blog application built to showcase flask).

For testing the application we can either use the built-in module [[https://docs.python.org/3/library/unittest.html | unittest]] and/or [[ https://docs.pytest.org/en/latest/ | pytest ]].

Then we could start adding test for basic functionalities (e.g. login and logout first), the tests should run mocked responses (i.e. not making real requests to Wikipedia) and write data to a local database (we need a specification somewhere of the schema of such database).

I will start adding several subtask to this one, to track the several things.

Comments are welcome.

Related Objects

StatusSubtypeAssignedTask
ResolvedPintoch
ResolvedPintoch
OpenNone
OpenNone