magic-wormhole / magic-wormhole

get things from one computer to another, safely
MIT License
20.35k stars 641 forks source link

Reduce mock usage in transit-relay tests #544

Open meejah opened 1 month ago

meejah commented 1 month ago

The ticket https://github.com/magic-wormhole/magic-wormhole/issues/543 kind of serves as an object lesson in "why Mock can be annoying and bad".

Some refactoring between 0.1.2 and 0.3.1 caused some internals in Transit Relay to shift around, but because the magic-wormhole tests depend heavily on internals (through use of Mock, and assert()-ing on internal calls) it is kind of painful to upgrade.

The magic-wormhole tests should only use public APIs from magic-wormhole-transit-relay

meejah commented 1 month ago

Hmm, what is maybe actually going on here is that when transit relay was separated out, not all of the relevant tests got moved. Arguably a bunch (or all?) of test_transit should probably just be moved over to the other repository.