Skip to content

Apply fixes for Segmentfactory and Pluginmount  #54

Closed
@mj0nez

Description

@mj0nez

Hey,
first, thanks for this amazing library, it has helped us a lot. I have noticed, that the in #37 proposed changes introduced more than a mapping functionality. With 23f218d fixes for the PluginMount and the SegmentFactory were introduced, which allow the inheritance based extension of Segment, while correctly evaluating the __omitted__ attribute.

With the current release this code

class TestSegment(Segment):

    tag = "TES"

    __omitted__ = False

    def validate(self) -> bool:
        pass


def test_has_plugin():
    plugins = SegmentProvider.plugins
    assert TestSegment in plugins

fails with

./tests/test_segment.py::test_has_plugin Failed: [undefined]assert TestSegment in []
def test_has_plugin():
        plugins = SegmentProvider.plugins
>       assert TestSegment in plugins
E       assert TestSegment in []

tests\test_segment.py:66: AssertionError

Could we merge those changes prior to the mapping extension? I will provide the necessary commits, but the credits belong to @theangryangel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions