示例#1
0
def test_custom_configure():
    '''Test configure helper with specific configurator.'''
    configurators = {'other': mock.Mock()}
    with mock.patch.dict(
        sawmill.configurators, configurators, clear=True
    ):
        sawmill.configure(configurator='other')
        assert configurators['other'].called
示例#2
0
def test_default_configure():
    '''Test configure helper with no arguments.'''
    configurators = {'classic': mock.Mock()}
    with mock.patch.dict(
        sawmill.configurators, configurators, clear=True
    ):
        sawmill.configure()
        assert configurators['classic'].called
示例#3
0
def test_configure_with_missing_configurator():
    '''Test configure raised ValueError for missing configurator.'''
    with mock.patch.dict(sawmill.configurators, clear=True):
        with pytest.raises(ValueError):
            sawmill.configure(configurator='other')