Commit Graph

12 Commits

Author SHA1 Message Date
Vsevolod Fedorov f4d64f9f66 Move tests to pytest
Pytest makes each scenario into individual selectable test.
To be able to run each scenario separately is very useful for development.

Change-Id: I4b1c990a1fd839ce327cd7faa27159a9b9632fed
2022-12-20 10:44:43 +03:00
Thanh Ha 4d90c187a9 Auto-generated output from python-black
Please review the following patch containing the code changes in
the repo. This patch is a transition patch and is the auto-generated
output of the python-black tool.

Change-Id: I2d2de71da8a105fb62b561899ae78441ddab4032
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2019-09-09 19:23:24 +01:00
Darragh Bailey 4573b3a25d Refactor base test classes inheritance for reuse
Refactor base test class inheritance to allow for BaseTest class to be
reused without needing to also import the TestCase class everywhere in
order to avoid having the common test function executed on base classes.

This makes it easier to build base testing classes and then simplifies
the subclassing of these for actual tests.

Change-Id: I89809e8082469f814f245db4a9ab7658aac8a405
2016-09-14 14:58:57 +01:00
Darragh Bailey 8805a34c0f Reorder imports to match hacking guidelines
Ensure that the imports follow the standard OpenStack hacking
guidelines.

Change-Id: Iaa4326aef118ddfd807dd006934f1d9ca80a1cfa
2015-12-23 15:23:42 -08:00
Darragh Bailey 9bfbffa559 Capture logs with FakeLogging Fixture
Capture logs to attach them on exceptions to simplify the debugging of
errors in tests when they occur.

Change-Id: I5c1b5c306aba37789a8d41eabf65e0ac628af838
2015-09-30 16:25:22 +01:00
Khai Do b790bbc681 update doc and add new JJB unit tests
Add documentation on how to generate documentation and run JJB unit tests.

Also added a unit tests for each category of plugins as examples for others
to follow when adding new JJB plugins.  I'm hoping this will help contributors
add tests for new plugins going forward.

Change-Id: I2ab90cdb37d0f3b1e947345d4291d2927b04a0c6
2013-11-22 17:51:17 +00:00
Felipe Reyes 894c72efcf New base class to declare test cases and tests to the node option
This patch refactors the tests suite to use a base class to declare test cases
just using a class declaration, the existing test class was modified to use it
and new tests are using it as well.

These tests verify the XML generated when the 'node' option is set and
when it's absent.

Change-Id: Iddcdd63e0ab7c459f6513b1d1ebf19e19a362c1d
2013-11-14 13:53:23 +01:00
Felipe Reyes 7d4d411676 Moved get_scenarios() function to a base module to make it easier to reuse
This will let other tests use it to find fixtures

Change-Id: I4253bb0f742373f8f79dd4bb5886ef98ba81538c
2013-10-02 10:37:40 -03:00
Clark Boylan b8fbb7193d Add python26 multiline string assertion back.
The assertMultiline equal was removed for assertEqual to be python26
friendly. Testtools has a matcher that provides similar functionality
that is python26 compatible. Use testtools instead of unittest for this
functionality. Remove use of unittest.main().

Change-Id: I348b0ee0192d3164084c20d9356e69f29e1cb86c
2013-07-24 13:40:33 -07:00
Paul Belanger 96211e74d6 Add python26 support
Change-Id: I1e4b388135ce73f34ba594943c4ae7e5f2dadeba
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
2013-07-19 23:29:29 -04:00
Arnaud Fabre a9cf2a2661 Tests: Use a testscenarios for running tests.
Instead of using load_tests to build a test suite out of a single
test case, rely on testscenarios. This library aims at running the
same test with different input data (`scenarios').

Some code is moved inside the test case to reduce the number of
scenario parameters (previously fixtures).

Change-Id: Iedb4cb3ad6341a9b397fa305b1ce2b329b6fdc15
2013-07-19 14:08:02 -07:00
Antoine Musso b829874916 Tests for publishers
I am trying to build up a very basic testing framework so we can tests
our publishers. The idea is to provide a YAML input file and expected
XML output, run the parser on the YAML file and compares its output with
the fixture XML.

That test suite should speed up development of new publishers.

TestCaseModulePublisher is declared inside a function so that unittest
discovery does not consider it a usable test directly. load_test is
responsible for instantiating the test suite.

Change-Id: If3260113eb1337ac47c3883b11c600e5a595dae3
[fabre.arnaud@gmail.com: fixed some runtime errors]
Signed-off-by: Arnaud Fabre <fabre.arnaud@gmail.com>
2013-07-19 14:31:11 +02:00