Is there any tutorials on writing unit test?

Asked by shiyanchdev@163.com

I am trying to provide unit tests for new functionality in Rally, but I have no idea where to start, nor could I find any wiki or tutorials on that. How does the unit test work for Rally? Is there any materials that I can refer to? Many thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Rally Edit question
Assignee:
Boris Pavlovic Edit question
Solved by:
Boris Pavlovic
Solved:
Last query:
Last reply:
Revision history for this message
Best Boris Pavlovic (boris-42) said :
#1

Unfortunately we don't have any tutorials.

What kind of information you are looking for?

  *) We are using testtools: https://testtools.readthedocs.org/en/latest/

  *) To run locally tests you should:
      pip install "tox==1.6.1" # install tox 1.6.1 version
      tox # run tox
      tox -e <option> # to run specific case: cover, doc, pep8, py26 or py27

   *) Test are under this directory: https://github.com/stackforge/rally/tree/master/tests

    *) Test structure should the similar to the structure of code base

    *) New code should be covered 100% by unit tests (to check it use tox -e cover)

I hope this helps

Revision history for this message
shiyanchdev@163.com (shiyanchdev) said :
#2

Thanks Boris Pavlovic, that solved my question.