예제 #1
0
def test_hook_inherited():
    class MyLineEdit(QLineEdit):
        pass

    widget = MyLineEdit()
    config = ConfigManager()
    assert config._get_hook(widget) == QLineEdit
예제 #2
0
def test_hook_inherited_direct():
    class MyLineEdit(QLineEdit):
        pass

    widget = MyLineEdit()
    config = ConfigManager()
    config.add_hooks(MyLineEdit, (_get_QLineEdit, _set_QLineEdit, _event_QLineEdit))
    assert config._get_hook(widget) == MyLineEdit
예제 #3
0
def test_no_hook():
    class MyTestClass:
        pass

    o = MyTestClass()
    config = ConfigManager()
    with pytest.raises(TypeError) as e:
        assert config._get_hook(o)
    assert "No handler-functions available for this" in str(e)
예제 #4
0
def test_hook_direct():
    widget = QLineEdit()
    config = ConfigManager()
    assert config._get_hook(widget) == QLineEdit
예제 #5
0
def test_hook_direct():
    widget = QLineEdit()
    config = ConfigManager()
    assert config._get_hook(widget) == QLineEdit