[Intelmq-dev] dev: writing similiar tests and test_bot_name()

Bernhard Reiter bernhard at intevation.de
Wed Oct 19 10:36:07 CEST 2016


Hi IntelMQ-Devs,

when writing tests what is your development suggestion for
writing similiar tests?

My problem:

  intelmq/lib/test.py test_bot_name()
checks that "Test class name must be Test{botclassname}."

But sometimes it would make sense to have a second test class
within one test file. For example in   
  intelmq/tests/bots/experts/modify/test_expert.py 
I am reusing some of the data of this tile.
On this occasion I have used a different class name and
explicitely disabled the test_bot_name().

You can reach the code via this search:
https://github.com/certtools/intelmq/search?utf8=%E2%9C%93&q=test_bot_name

I can see some merit checking for a consistent naming.
However making it easier to write more tests is also a good aim
and it looks like a good pattern to write more than one test class
within one file.

What is your idea of solving this in the future?

(I meanwhile add another test using the same trick.)

Best Regards,
Bernhard



-- 
www.intevation.de/~bernhard   +49 541 33 508 3-3
Intevation GmbH, Osnabrück, DE; Amtsgericht Osnabrück, HRB 18998
Geschäftsführer Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.cert.at/pipermail/intelmq-dev/attachments/20161019/2bf90e57/attachment.sig>


More information about the Intelmq-dev mailing list