autotest/autotest-docker — pull request #398 by cevich (2014-11-05 21:14:45+00:00)
Title: [RFC] dockertest: Add mediator singleton [RFC] 

Just an idea I had that would let key module's classes/instances interact with others via functions/methods we write in ``mediator_mixins.py``. The mediator singleton is instantiated by the control file (no changes needed) and injected into all key modules as an attribute. Then, all interactions between instances goes through the mediator methods. This way, all tests and modules only need access the mediator for everything (no more ``import dockertest.kitchen-sink``). This prevents circular dependencies, allows us to extend the dockertest API almost at-will, keep existing unittests, and prevents any context/namespace clobbering (since dockertest module is unloaded in-between tests by control file). The one mixin' function ``get_config(name)`` is just a very simple example. In reality, all modules have access to the mediator singleton and can use it to interact with any other module's instances/classes (by mediated functions). Sorry it's kind of confusing, try to understand how it works before criticizing too heavily :grinning: