Example #1
0
def test_BaseCommandController_create():
    tv = None
    c1 = BaseCommandController.create()
    assert isinstance(c1, BaseCommandController)
    c2 = BaseCommandController.create()
    assert isinstance(c2, BaseCommandController)
    assert c1 is not c2
Example #2
0
def test_BaseCommandController_options():
    with replattr(BaseCommandController, "OPTIONS_CLASS", FakeOptions):
        ctl = BaseCommandController.create()
        #assert isinstance(ctl.opts, FakeOptions), ctl.opts
        eq_(type(ctl.opts).__name__, "FakeOptions_KVOProxy")
        assert ctl.opts is ctl.options()
        obj = object()
        ctl.setOptions_(obj)
        eq_(ctl.options(), obj)
Example #3
0
def test_BaseCommandController_shared_controller():
    cx = BaseCommandController.shared_controller()
    c1 = OtherController.shared_controller()
    assert isinstance(c1, OtherController), c1
    c2 = OtherController.shared_controller()
    assert c1 is c2, (c1, c2)