Exemple #1
0
def test_map_liveproperty():
    assert prop.providing_class("livewidget") is PropertyForLiveUse

    with assert_raises(NameError):
        prop.providing_class("widget") # unavailable as a live property
Exemple #2
0
def test_map_nonexistent_name():
    with assert_raises(NameError):
        prop.providing_class("widget", soh.HandlerBase)
    with assert_raises(NameError):
        prop.providing_class("robin", _TestOutputHandler1)
Exemple #3
0
def test_map_overloaded_name():
    assert prop.providing_class("widget", _TestOutputHandler1) is PropertyForHandler1
    assert prop.providing_class("widget", _TestOutputHandler2) is PropertyForHandler2
Exemple #4
0
def test_map_precedence():
    # The most specific version of the property should be used, not the "more generic" version (PropertyForHandler1):
    assert prop.providing_class("hedgehog", _TestOutputHandler1Child) is PropertyForHandler1Child
Exemple #5
0
def test_map_unique_name():
    assert prop.providing_class("robin", _TestOutputHandler2) is PropertyForHandler2
    assert prop.providing_class("hedgehog", _TestOutputHandler1) is PropertyForHandler1