python-utility-scripts 0.0.10__tar.gz → 0.0.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-utility-scripts
3
- Version: 0.0.10
3
+ Version: 0.0.11
4
4
  Summary: Python utility scripts
5
5
  Home-page: https://github.com/RedHatQE/python-utility-scripts
6
6
  License: Apache-2.0
@@ -23,9 +23,13 @@ def git_diff_lines():
23
23
  return diff
24
24
 
25
25
 
26
- def validate_polarion_requirements(polarion_test_ids, polarion_project_id):
26
+ def validate_polarion_requirements(
27
+ polarion_test_ids,
28
+ polarion_project_id,
29
+ ):
30
+ from pylero.work_item import TestCase, Requirement
31
+
27
32
  tests_with_missing_requirements = []
28
- from pylero.work_item import Requirement, TestCase
29
33
 
30
34
  for _id in polarion_test_ids:
31
35
  has_req = False
@@ -3,14 +3,13 @@ import logging
3
3
  from simple_logger.logger import get_logger
4
4
  import os
5
5
  import click
6
-
7
6
  from apps.polarion.polarion_utils import (
8
7
  git_diff_lines,
9
8
  validate_polarion_requirements,
10
9
  )
11
10
  from apps.utils import get_util_config
12
11
 
13
- LOGGER = get_logger(name=__name__)
12
+ LOGGER = get_logger(name="polarion-verify-tc-requirements")
14
13
 
15
14
 
16
15
  @click.command()
@@ -25,11 +24,14 @@ LOGGER = get_logger(name=__name__)
25
24
  def has_verify(config_file_path, project_id, verbosity):
26
25
  if verbosity:
27
26
  LOGGER.setLevel(logging.DEBUG)
27
+
28
28
  polarion_project_id = project_id or get_util_config(
29
- util_name="pyutils-polarion-verify-tc-requirements", config_file_path=config_file_path
29
+ util_name="pyutils-polarion-verify-tc-requirements",
30
+ config_file_path=config_file_path,
30
31
  ).get("project_id")
32
+
31
33
  if not polarion_project_id:
32
- click.echo("Polarion project id must be passed via config file or command line")
34
+ LOGGER.error("Polarion project id must be passed via config file or command line")
33
35
  raise click.Abort()
34
36
 
35
37
  if added_ids := re.findall(
@@ -39,7 +41,8 @@ def has_verify(config_file_path, project_id, verbosity):
39
41
  ):
40
42
  LOGGER.debug(f"Checking following ids: {added_ids}")
41
43
  if tests_with_missing_requirements := validate_polarion_requirements(
42
- polarion_test_ids=added_ids, polarion_project_id=polarion_project_id
44
+ polarion_test_ids=added_ids,
45
+ polarion_project_id=polarion_project_id,
43
46
  ):
44
47
  click.echo(f"TestCases with missing requirement: {tests_with_missing_requirements}")
45
48
  raise click.Abort()
@@ -20,7 +20,7 @@ exclude = [".git", ".venv", ".mypy_cache", ".tox", "__pycache__"]
20
20
 
21
21
  [tool.poetry]
22
22
  name = "python-utility-scripts"
23
- version = "0.0.10"
23
+ version = "0.0.11"
24
24
  description = "Python utility scripts"
25
25
  authors = ["dbasunag <dbasunag@redhat.com>"]
26
26
  license = "Apache License 2.0"
@@ -63,6 +63,7 @@ pattern = "((?P<epoch>\\d+)!)?(?P<base>\\d+(\\.\\d+)*)"
63
63
 
64
64
 
65
65
 
66
+
66
67
  [tool.poetry.group.test.dependencies]
67
68
  pytest = "^8.0.0"
68
69
  pytest-cov = "^4.1.0"