def _adopt_info_extension_fixture(): class ExtensionImpl(Extension): @staticmethod def get_supported_bases() -> Tuple[str, ...]: return ("core18",) @staticmethod def get_supported_confinement() -> Tuple[str, ...]: return ("strict",) def __init__(self, extension_name, yaml_data): super().__init__(extension_name=extension_name, yaml_data=yaml_data) self.root_snippet = {"adopt-info": "some-part-name"} return fixture_setup.FakeExtension("adopt", ExtensionImpl)
def _invalid_extension_fixture(): class ExtensionImpl(Extension): @staticmethod def get_supported_bases() -> Tuple[str, ...]: return ("core18",) @staticmethod def get_supported_confinement() -> Tuple[str, ...]: return ("strict",) def __init__(self, extension_name, yaml_data): super().__init__(extension_name=extension_name, yaml_data=yaml_data) self.app_snippet = {"unsupported-key": "value"} return fixture_setup.FakeExtension("invalid", ExtensionImpl)
def _plug2_extension_fixture(): class ExtensionImpl(Extension): @staticmethod def get_supported_bases() -> Tuple[str, ...]: return ("core18",) @staticmethod def get_supported_confinement() -> Tuple[str, ...]: return ("strict",) def __init__(self, extension_name, yaml_data): super().__init__(extension_name=extension_name, yaml_data=yaml_data) self.app_snippet = {"plugs": ["test-plug2"]} return fixture_setup.FakeExtension("plug2", ExtensionImpl)
def _test4_extension_fixture(): class ExtensionImpl(Extension): @staticmethod def get_supported_bases() -> Tuple[str, ...]: return ("core20", "core18") @staticmethod def get_supported_confinement() -> Tuple[str, ...]: return ("strict", ) def __init__(self, extension_name, yaml_data): super().__init__(extension_name=extension_name, yaml_data=yaml_data) self.parts = {"extension-part": {"plugin": "nil"}} return fixture_setup.FakeExtension("_test4", ExtensionImpl)
def _environment_extension_fixture(): class ExtensionImpl(Extension): @staticmethod def get_supported_bases() -> Tuple[str, ...]: return ("core18",) @staticmethod def get_supported_confinement() -> Tuple[str, ...]: return ("strict",) def __init__(self, extension_name, yaml_data): super().__init__(extension_name=extension_name, yaml_data=yaml_data) self.root_snippet = {"environment": {"TEST_EXTENSION": 1}} self.app_snippet = {"environment": {"TEST_EXTENSION": 1}} self.part_snippet = {"after": ["extension-part"]} self.parts = {"extension-part": {"plugin": "nil"}} return fixture_setup.FakeExtension("environment", ExtensionImpl)
def _test2_extension_fixture(): class ExtensionImpl(Extension): """This is the Test2 extension. It does other stuff. """ @staticmethod def get_supported_bases() -> Tuple[str, ...]: return ("core20", ) @staticmethod def get_supported_confinement() -> Tuple[str, ...]: return ("strict", ) def __init__(self, extension_name, yaml_data): super().__init__(extension_name=extension_name, yaml_data=yaml_data) self.part_snippet = {"after": ["extension-part"]} self.parts = {"extension-part": {"plugin": "nil"}} return fixture_setup.FakeExtension("test2", ExtensionImpl)
def _build_environment2_extension_fixture(): class ExtensionImpl(Extension): @staticmethod def get_supported_bases() -> Tuple[str, ...]: return ("core18",) @staticmethod def get_supported_confinement() -> Tuple[str, ...]: return ("strict",) def __init__(self, extension_name, yaml_data): super().__init__(extension_name=extension_name, yaml_data=yaml_data) self.root_snippet = {} self.app_snippet = {} self.part_snippet = { "after": ["extension-part2"], "build-environment": [ {"PATH": "$PATH:/extension-path2"}, {"EXTKEY": "EXTVAL2"}, ], } self.parts = {"extension-part2": {"plugin": "nil"}} return fixture_setup.FakeExtension("buildenvironment2", ExtensionImpl)