Page MenuHomePhabricator

Add a testing infrastructure
Closed, ResolvedPublic


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 [[ | src ]] directory:

├─ src
│  └─ oabot
│     ├─
│     ├─ ...
│     ├─ static
│     │  ├─  css
│     │  └─ js
│     └─ templates
├─ tests
│  └─ ...

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 [[ | unittest]] and/or [[ | 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