def test_missing_buildstep(self):
        project = self.create_project()
        plan = self.create_plan(project)
        self.create_option(item_id=plan.id, name='snapshot.allow', value='1')

        result = get_snapshottable_plans(project)
        assert result == []
    def test_missing_buildstep(self):
        project = self.create_project()
        plan = self.create_plan(project)
        self.create_option(item_id=plan.id, name='snapshot.allow', value='1')

        result = get_snapshottable_plans(project)
        assert result == []
    def test_autogenerated_plan(self):
        project = self.create_project()
        plan = self.create_plan(project)
        self.create_option(item_id=plan.id, name='snapshot.allow', value='1')
        self.create_option(item_id=plan.id, name='bazel.autogenerate', value='1')

        result = get_snapshottable_plans(project)
        assert result == [plan]
    def test_valid_plan(self, mock_get_implementation):
        project = self.create_project()
        plan = self.create_plan(project)
        self.create_step(plan)
        self.create_option(item_id=plan.id, name='snapshot.allow', value='1')

        mock_get_implementation.return_value = SnapshottableBuildStep()

        result = get_snapshottable_plans(project)
        assert result == [plan]
    def test_valid_plan(self, mock_get_implementation):
        project = self.create_project()
        plan = self.create_plan(project)
        self.create_step(plan)
        self.create_option(item_id=plan.id, name='snapshot.allow', value='1')

        mock_get_implementation.return_value = SnapshottableBuildStep()

        result = get_snapshottable_plans(project)
        assert result == [plan]
Beispiel #6
0
    def test_autogenerated_plan(self):
        project = self.create_project()
        plan = self.create_plan(project)
        self.create_option(item_id=plan.id, name='snapshot.allow', value='1')
        self.create_option(item_id=plan.id,
                           name='bazel.autogenerate',
                           value='1')

        result = get_snapshottable_plans(project)
        assert result == [plan]
    def test_dependent_snapshot_plan(self, mock_get_implementation):
        project = self.create_project()
        plan_1 = self.create_plan(project)
        plan_2 = self.create_plan(project)
        plan_1.snapshot_plan_id = plan_2.id

        mock_get_implementation.return_value = SnapshottableBuildStep()
        self.create_option(item_id=plan_1.id, name='snapshot.allow', value='1')
        self.create_step(plan_1)

        result = get_snapshottable_plans(project)
        assert result == []
    def test_dependent_snapshot_plan(self, mock_get_implementation):
        project = self.create_project()
        plan_1 = self.create_plan(project)
        plan_2 = self.create_plan(project)
        plan_1.snapshot_plan_id = plan_2.id

        mock_get_implementation.return_value = SnapshottableBuildStep()
        self.create_option(item_id=plan_1.id, name='snapshot.allow', value='1')
        self.create_step(plan_1)

        result = get_snapshottable_plans(project)
        assert result == []