Esempio n. 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
Esempio n. 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)
Esempio n. 3
0
def test_map_overloaded_name():
    assert prop.providing_class("widget", _TestOutputHandler1) is PropertyForHandler1
    assert prop.providing_class("widget", _TestOutputHandler2) is PropertyForHandler2
Esempio n. 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
Esempio n. 5
0
def test_map_unique_name():
    assert prop.providing_class("robin", _TestOutputHandler2) is PropertyForHandler2
    assert prop.providing_class("hedgehog", _TestOutputHandler1) is PropertyForHandler1