def test_manipulator_remove_plugin(self): inner = copy.deepcopy(TEST_INNER_DOCK_JSON) m = DockJsonManipulator(TEST_BUILD_JSON, inner) m.remove_plugin("postbuild_plugins", "all_rpm_packages") assert len([ x for x in inner["postbuild_plugins"] if x.get("all_rpm_packages", None) ]) == 0
def render(self, validate=True): if validate: self.spec.validate() super(ProductionBuild, self).render() dj = DockJsonManipulator(self.template, self.inner_template) self.template['parameters']['output']['imageTag'] = self.spec.image_tag.value # if there is yum repo specified, don't pick stuff from koji if self.spec.yum_repourls.value: logger.info("removing koji from request, because there is yum repo specified") dj.remove_plugin("prebuild_plugins", "koji") else: dj.dock_json_set_arg('prebuild_plugins', "koji", "target", self.spec.koji_target.value) dj.dock_json_set_arg('prebuild_plugins', "koji", "root", self.spec.kojiroot.value) dj.dock_json_set_arg('prebuild_plugins', "koji", "hub", self.spec.kojihub.value) dj.write_dock_json() self.build_json = self.template logger.debug(self.build_json) return self.build_json
def test_manipulator_remove_nonexisting_plugin(self): inner = copy.deepcopy(TEST_INNER_DOCK_JSON) m = DockJsonManipulator(TEST_BUILD_JSON, inner) m.remove_plugin("postbuild_plugins", "this-doesnt-exist")
def test_manipulator_remove_nonexisting_plugin(self): inner = copy.deepcopy(TEST_INNER_DOCK_JSON) m = DockJsonManipulator(TEST_BUILD_JSON, inner) m.remove_plugin("postbuild_plugins", "this-doesnt-exist")
def test_manipulator_remove_plugin(self): inner = copy.deepcopy(TEST_INNER_DOCK_JSON) m = DockJsonManipulator(TEST_BUILD_JSON, inner) m.remove_plugin("postbuild_plugins", "all_rpm_packages") assert len([x for x in inner["postbuild_plugins"] if x.get("all_rpm_packages", None)]) == 0