Commit c9edaa0d authored by Mathieu Coupé's avatar Mathieu Coupé Committed by Pierre Smeyers
Browse files

test(pytest): init unit tests

parent 87744904
Loading
Loading
Loading
Loading

.coveragerc

0 → 100644
+6 −0
Original line number Diff line number Diff line
[run]
# enables branch coverage
branch = True
# list of directories/packages to cover
source =
    gitlab_butler
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ include:
      ruff-enabled: true
      package-enabled: true
      release-enabled: true
      pytest-enabled: true
  # semantic-release template
  - component: "$CI_SERVER_FQDN/to-be-continuous/semantic-release/gitlab-ci-semrel@3.11"
    inputs:
+2 −3
Original line number Diff line number Diff line
@@ -379,7 +379,6 @@ class Butler:
                        print('Pipeline deletion limit reached, stopping processing for this project.')
                    return


    # Cleanup recursively a GitLab group
    # $1: group to be cleaned
    def clean_group(self, group: Group) -> None:
@@ -393,7 +392,7 @@ class Butler:
            manageable_project = self.client.projects.get(project.id)
            if self.is_excluded(manageable_project.path_with_namespace):
                print(
                    f"  - 🏠 Project {AnsiColors.BLUE}{project.path_with_namespace}{AnsiColors.RESET} matches excludes: {AnsiColors.HGRAY}skip{AnsiColors.RESET}"
                    f"  - 🏠 Project {AnsiColors.BLUE}{manageable_project.path_with_namespace}{AnsiColors.RESET} matches excludes: {AnsiColors.HGRAY}skip{AnsiColors.RESET}"
                )
            else:
                self.clean_project(manageable_project)
+114 −58

File changed.

Preview size limit exceeded, changes collapsed.

+5 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ pyyaml = "^6.0.1"
pytest = "^8.0.0"
pytest-cov = "^5.0.0"
pytest-env = "^1.0.0"
pytest-mock = "^3.14.0"
responses = "^0.25.3"
mypy = "^1.0.0"
ruff = "^0.5.0"

@@ -34,6 +36,9 @@ ruff = "^0.5.0"
testpaths = [
    "tests",
]
addopts = [
    "--import-mode=importlib",
]

[tool.ruff.lint]
extend-select = ["I"] # isort
Loading