HomePhabricator

Add unit tests for Flask application update endpoint

Authored by JeanFred on Oct 13 2019, 9:50 PM.

Description

Add unit tests for Flask application update endpoint

The update endpoint is where everything happens,
so it requires some more advanced testing.

  • Separate unit tests in two classes:
    • BasicTests for the simple tests added in 505736f and 6639db1
    • UpdateTests for the new tests for the update endpoint
  • Add test fixtures for the UpdateTests class, patching the PagesProcessor object
  • Add helper assertion methods, assertSuccessPage and assertErrorPage
  • Add three unit tests for each use case:
    • Success, resulting in a success page
    • Expected error, resulting in a error page
    • Unexpected error, resulting in a error page with a different message

(We need another test for when no page is provided, but it turns
out this is currently not well handled by the application.)

Details

Committed
JeanFredOct 13 2019, 10:03 PM
Parents
R2566:505736f65196: Add unit test for Flask application 404 page
Branches
Unknown
Tags
Unknown
ChangeId
None