Santandersecurityresearch/DrHeader

Improve test coverage

amias-channer opened this issue · 1 comments

  • drHEADer version: 1.0.0
  • Python version: any
  • Operating System: any

Description

DrHeader currently has one test class which contains only a few tests and this doesn't seem to give much coverage of its functionality.

Tests follow the form of preparing a headers definition , then feeding this through an instance of DrHeader and the asserting on the results.

This is currently done in individual test methods which is time consuming.

We can recreate them as python generator based test which could iterate through a large data structure containing a test name , parameters and expected results.
This would allow for new tests to be added easily and for coverage to be rapidly improved.

Pytest is particularly good at this and various methods to achieve it are explained here
http://doc.pytest.org/en/latest/example/parametrize.html

Deliverables

  • Schema for the datastructure
  • Test generator to iterate through datastrucure
  • Tickets to create missing tests

Tests have been updated to use nosetests and have been enhanced to get better coverage and better results.

Onging test review will occur.