def __init__(self, meson_api: MesonAPI): super(self.__class__, self).__init__(meson_api) self.backend: str = '\'kdevelop\'' self.buildoptions = BuildOption(meson_api=meson_api) self.projectinfo = ProjectInfo(meson_api=meson_api) self.mesoninfo = MesonInfo(meson_api=meson_api) self.meson = Meson()
def test_option_not_found(self): source = join('test-cases', 'meson-api', '01-scan-script') build = join('test-cases', 'meson-api', '01-scan-script', 'builddir') meson: Meson = Meson(sourcedir=source, builddir=build) meson.setup() api: MesonAPI = MesonAPI(sourcedir=source, builddir=build) option: BuildOption = BuildOption(api) with pytest.raises(MesonUiException) as e: option.integer('smap-option') assert ('Option smap-option not found!' == str(e.value))
def test_combo(self): source = join('test-cases', 'meson-api', '01-scan-script') build = join('test-cases', 'meson-api', '01-scan-script', 'builddir') meson: Meson = Meson(sourcedir=source, builddir=build) meson.setup() api: MesonAPI = MesonAPI(sourcedir=source, builddir=build) option: BuildOption = BuildOption(api) opt = option.combo('backend') assert (opt.section in MESON_OPTION_SECTION) assert (opt.machine in MESON_OPTION_MACHINE) assert (opt.type in MESON_OPTION_TYPES)
def test_array_wrong_type_name_pram(self): source = join('test-cases', 'meson-api', '01-scan-script') build = join('test-cases', 'meson-api', '01-scan-script', 'builddir') meson: Meson = Meson(sourcedir=source, builddir=build) meson.setup() api: MesonAPI = MesonAPI(sourcedir=source, builddir=build) option: BuildOption = BuildOption(api) with pytest.raises(MesonUiException) as e: option.array(None) assert ('Option has wrong type <class \'NoneType\'> should be string!' == str(e.value))