On 14 January 2014 12:05, Mateusz ?oskot <mateusz@...> wrote:
2) What about having both assertions, would that break the single
assertion rule?
self.assertTrue(item_exists)
foo.xdep.get_item.assert_called_once_with(1)
[...]
3) AFAIU, it's natural that unit tests are coupled with implementation of
method/behaviour they are testing, foo.exists function in my case.
[...]
I'm re-reading my own post and realising, aren't 2) and 3)
breaking the guideline [1] about writing tests to the interface,
not the implementation?
I think the original version of test_exists_ExistingItemId_ReturnTrue
I've got is written to the interface and mocks only bare minimum
of required dependencies.
Anyone could help me out to get in order with
terminology vs practice vs best practices here?
How much unit tests should know about implementation of what is being tested?
[1] "Stop Mocking, Start Testing" Augie Fackler and Nathaniel Manista at Google
Best regards,
--
Mateusz ?oskot,