def test_map_liveproperty(): assert prop.providing_class("livewidget") is PropertyForLiveUse with assert_raises(NameError): prop.providing_class("widget") # unavailable as a live property
def test_map_nonexistent_name(): with assert_raises(NameError): prop.providing_class("widget", soh.HandlerBase) with assert_raises(NameError): prop.providing_class("robin", _TestOutputHandler1)
def test_map_overloaded_name(): assert prop.providing_class("widget", _TestOutputHandler1) is PropertyForHandler1 assert prop.providing_class("widget", _TestOutputHandler2) is PropertyForHandler2
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
def test_map_unique_name(): assert prop.providing_class("robin", _TestOutputHandler2) is PropertyForHandler2 assert prop.providing_class("hedgehog", _TestOutputHandler1) is PropertyForHandler1