├── .coveragerc ├── .gitattributes ├── .github └── workflows │ ├── codeql-analysis.yml │ ├── publish-to-pypi.yml │ └── pull_request.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .project ├── .tito ├── packages │ ├── .readme │ └── python-pylero └── tito.props ├── CONTRIBUTION.rst ├── LICENSE ├── MANIFEST.in ├── README.md ├── doc ├── Makefile ├── _build │ └── docs ├── conf.py ├── index.rst ├── make.bat ├── modules.rst ├── pylero.cli.rst └── pylero.rst ├── docs ├── .buildinfo ├── .nojekyll ├── _modules │ ├── index.html │ └── pylero │ │ ├── activity.html │ │ ├── activity_comment.html │ │ ├── activity_custom_value.html │ │ ├── activity_custom_value_entry.html │ │ ├── activity_source.html │ │ ├── approval.html │ │ ├── attachment.html │ │ ├── base_polarion.html │ │ ├── baseline.html │ │ ├── build.html │ │ ├── build_linked_work_item.html │ │ ├── build_test_results.html │ │ ├── category.html │ │ ├── change.html │ │ ├── cli │ │ └── cmd.html │ │ ├── comment.html │ │ ├── custom.html │ │ ├── custom_field.html │ │ ├── custom_field_type.html │ │ ├── document.html │ │ ├── enum_custom_field_type.html │ │ ├── enum_option.html │ │ ├── enum_option_id.html │ │ ├── exceptions.html │ │ ├── externally_linked_work_item.html │ │ ├── field_diff.html │ │ ├── hyperlink.html │ │ ├── imported_comment.html │ │ ├── language_definition.html │ │ ├── license_info.html │ │ ├── linked_work_item.html │ │ ├── module_comment.html │ │ ├── plan.html │ │ ├── plan_record.html │ │ ├── plan_statistics.html │ │ ├── planning_constraint.html │ │ ├── priority_opt.html │ │ ├── priority_option_id.html │ │ ├── product_license.html │ │ ├── project.html │ │ ├── project_group.html │ │ ├── properties.html │ │ ├── property.html │ │ ├── revision.html │ │ ├── server.html │ │ ├── session.html │ │ ├── signature.html │ │ ├── signature_context.html │ │ ├── signature_data.html │ │ ├── subterra_uri.html │ │ ├── test_record.html │ │ ├── test_run.html │ │ ├── test_run_attachment.html │ │ ├── test_step.html │ │ ├── test_step_result.html │ │ ├── test_steps.html │ │ ├── tests_configuration.html │ │ ├── text.html │ │ ├── time_point.html │ │ ├── user.html │ │ ├── wiki_page.html │ │ ├── wiki_page_attachment.html │ │ ├── work_record.html │ │ └── workflow_action.html ├── _sources │ ├── index.rst.txt │ ├── modules.rst.txt │ ├── pylero.cli.rst.txt │ └── pylero.rst.txt ├── _static │ ├── alabaster.css │ ├── basic.css │ ├── custom.css │ ├── doctools.js │ ├── documentation_options.js │ ├── file.png │ ├── language_data.js │ ├── minus.png │ ├── plus.png │ ├── pygments.css │ └── searchtools.js ├── genindex.html ├── index.html ├── modules.html ├── objects.inv ├── py-modindex.html ├── pylero.cli.html ├── pylero.html ├── search.html └── searchindex.js ├── gen_docs.sh ├── pyproject.toml ├── python-pylero.spec ├── requirements.txt ├── scripts ├── pylero └── pylero-cmd ├── setup.py ├── src ├── pylero │ ├── __init__.py │ ├── _compatible.py │ ├── activity.py │ ├── activity_comment.py │ ├── activity_custom_value.py │ ├── activity_custom_value_entry.py │ ├── activity_source.py │ ├── approval.py │ ├── attachment.py │ ├── base_polarion.py │ ├── baseline.py │ ├── build.py │ ├── build_linked_work_item.py │ ├── build_test_results.py │ ├── category.py │ ├── change.py │ ├── cli │ │ ├── __init__.py │ │ └── cmd.py │ ├── comment.py │ ├── custom.py │ ├── custom_field.py │ ├── custom_field_type.py │ ├── document.py │ ├── enum_custom_field_type.py │ ├── enum_option.py │ ├── enum_option_id.py │ ├── exceptions.py │ ├── externally_linked_work_item.py │ ├── field_diff.py │ ├── hyperlink.py │ ├── imported_comment.py │ ├── language_definition.py │ ├── license_info.py │ ├── linked_work_item.py │ ├── module_comment.py │ ├── plan.py │ ├── plan_record.py │ ├── plan_statistics.py │ ├── planning_constraint.py │ ├── priority_opt.py │ ├── priority_option_id.py │ ├── product_license.py │ ├── project.py │ ├── project_group.py │ ├── properties.py │ ├── property.py │ ├── pylero.cfg │ ├── revision.py │ ├── server.py │ ├── session.py │ ├── signature.py │ ├── signature_context.py │ ├── signature_data.py │ ├── subterra_uri.py │ ├── test_record.py │ ├── test_run.py │ ├── test_run_attachment.py │ ├── test_step.py │ ├── test_step_result.py │ ├── test_steps.py │ ├── tests_configuration.py │ ├── text.py │ ├── time_point.py │ ├── user.py │ ├── wiki_page.py │ ├── wiki_page_attachment.py │ ├── work_item.py │ ├── work_record.py │ └── workflow_action.py └── unit_tests │ ├── __init__.py │ ├── attribute_test.py │ ├── document_test.py │ ├── plan_test.py │ ├── refs │ └── red_box.png │ ├── revert_tests.py │ ├── test_run_test.py │ └── work_item_test.py ├── tier_tests.py └── tox.ini /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | include = .tox/*/pylero/* 4 | timid = True 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | doc/_build/* linguist-vendored 2 | docs/* linguist-vendored 3 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | # The branches below must be a subset of the branches above 8 | branches: [ main ] 9 | schedule: 10 | - cron: '21 11 * * 5' 11 | 12 | jobs: 13 | analyze: 14 | name: Analyze 15 | runs-on: ubuntu-latest 16 | permissions: 17 | actions: read 18 | contents: read 19 | security-events: write 20 | 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | language: [ 'python' ] 25 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 26 | # Learn more about CodeQL language support at https://git.io/codeql-language-support 27 | 28 | steps: 29 | - name: Checkout repository 30 | uses: actions/checkout@v3 31 | 32 | # Initializes the CodeQL tools for scanning. 33 | - name: Initialize CodeQL 34 | uses: github/codeql-action/init@v2 35 | with: 36 | languages: ${{ matrix.language }} 37 | # If you wish to specify custom queries, you can do so here or in a config file. 38 | # By default, queries listed here will override any specified in a config file. 39 | # Prefix the list here with "+" to use these queries and those in the config file. 40 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 41 | 42 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 43 | # If this step fails, then you should remove it and run the build manually (see below) 44 | # - name: Autobuild 45 | # uses: github/codeql-action/autobuild@v1 46 | 47 | # ℹ️ Command-line programs to run using the OS shell. 48 | # 📚 https://git.io/JvXDl 49 | 50 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 51 | # and modify them (or add more) to build your code if your project 52 | # uses a compiled language 53 | 54 | #- run: | 55 | # make bootstrap 56 | # make release 57 | 58 | - name: Perform CodeQL Analysis 59 | uses: github/codeql-action/analyze@v2 60 | -------------------------------------------------------------------------------- /.github/workflows/publish-to-pypi.yml: -------------------------------------------------------------------------------- 1 | name: Publish Pylero Python distributions to PyPI 2 | 3 | on: 4 | release: 5 | types: [created] 6 | 7 | jobs: 8 | build-n-publish: 9 | name: Build and publish Python distributions to PyPI 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | - name: Set up Python 14 | uses: actions/setup-python@v5 15 | with: 16 | python-version: '3.10' 17 | 18 | - name: Install pypa/build 19 | run: >- 20 | python -m 21 | pip install 22 | build 23 | --user 24 | - name: Build a binary wheel and a source tarball 25 | run: >- 26 | python -m 27 | build 28 | --sdist 29 | --outdir dist/ 30 | - name: Publish distribution to PyPI 31 | if: startsWith(github.ref, 'refs/tags') 32 | uses: pypa/gh-action-pypi-publish@release/v1 33 | with: 34 | user: __token__ 35 | password: ${{ secrets.PYPI_API_TOKEN }} 36 | skip_existing: true 37 | -------------------------------------------------------------------------------- /.github/workflows/pull_request.yml: -------------------------------------------------------------------------------- 1 | # CI stages to execute against Pull Requests 2 | name: Pylero - CI 3 | 4 | on: 5 | pull_request: 6 | types: ["opened", "synchronize", "reopened"] 7 | 8 | jobs: 9 | codechecks: 10 | name: Code Quality 11 | runs-on: ubuntu-latest 12 | strategy: 13 | matrix: 14 | python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"] 15 | steps: 16 | - name: Checkout Pylero 17 | uses: actions/checkout@v3 18 | 19 | - name: Set Up Python-${{ matrix.python-version }} 20 | uses: actions/setup-python@v3 21 | with: 22 | python-version: ${{ matrix.python-version }} 23 | 24 | - name: Install Dependencies 25 | run: | 26 | pip install -U pip 27 | pip install -U -r requirements.txt 28 | pip install . 29 | 30 | - name: Pre Commit Checks 31 | uses: pre-commit/action@v3.0.0 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | .pylero 3 | .pylarion 4 | *.egg-info* 5 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # configuration for pre-commit git hooks 2 | exclude: '^docs' 3 | repos: 4 | - repo: https://github.com/asottile/reorder_python_imports 5 | rev: v3.9.0 6 | hooks: 7 | - id: reorder-python-imports 8 | - repo: https://github.com/pre-commit/pre-commit-hooks 9 | rev: v4.4.0 10 | hooks: 11 | - id: trailing-whitespace 12 | - id: end-of-file-fixer 13 | - id: debug-statements 14 | - id: detect-private-key 15 | - repo: https://github.com/psf/black 16 | rev: 23.3.0 17 | hooks: 18 | - id: black 19 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | pylero 4 | 5 | 6 | 7 | 8 | 9 | org.python.pydev.PyDevBuilder 10 | 11 | 12 | 13 | 14 | 15 | org.python.pydev.pythonNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.tito/packages/.readme: -------------------------------------------------------------------------------- 1 | the .tito/packages directory contains metadata files 2 | named after their packages. Each file has the latest tagged 3 | version and the project's relative directory. 4 | -------------------------------------------------------------------------------- /.tito/packages/python-pylero: -------------------------------------------------------------------------------- 1 | 0.1.1-1 ./ 2 | -------------------------------------------------------------------------------- /.tito/tito.props: -------------------------------------------------------------------------------- 1 | [buildconfig] 2 | builder = tito.builder.Builder 3 | tagger = tito.tagger.VersionTagger 4 | changelog_do_not_remove_cherrypick = 0 5 | changelog_format = %s (%ae) 6 | -------------------------------------------------------------------------------- /CONTRIBUTION.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | Contribution Guideline 3 | ====================== 4 | 5 | 6 | Welcome to the contribution guideline page! 7 | 8 | Setting up the environment 9 | ========================== 10 | 11 | ----------------- 12 | Installing pip 13 | ----------------- 14 | This project uses `pip `_ as a package manager. To install, simply run the follow command: 15 | 16 | .. code-block:: bash 17 | 18 | $ python -m pip install 19 | 20 | ------------------------ 21 | Installing pre-commit 22 | ------------------------ 23 | `pre-commit `_ is a multi-language package manager for pre-commit hooks. It is used to check code before it makes it to commit. A list of hooks is specified in `.pre-commit-config.yaml` in the root directory of the project. 24 | To install `pre-commit`, simply run the following command: 25 | 26 | .. code-block:: bash 27 | 28 | $ pip install pre-commit 29 | 30 | 31 | ----------------- 32 | Before you commit 33 | ----------------- 34 | 35 | In order to ensure you are able to pass the GitHub CI build, it is recommended that you run the following commands in the base of your pylero directory 36 | 37 | .. code-block:: python 38 | 39 | $ pre-commit autoupdate && pre-commit run -a 40 | 41 | 42 | 43 | Pre-commit will ensure that the changes you made are not in violation of PEP8 standards and automatically apply black fixes. 44 | 45 | We recommend `black` to automatically fix any pre-commit failures. 46 | 47 | .. code-block:: python 48 | 49 | $ pip install black 50 | $ black 51 | 52 | 53 | ----------------------------------- 54 | Fork the project and clone the repo 55 | ----------------------------------- 56 | 57 | .. code-block:: bash 58 | 59 | $ git clone https://github.com//pylero.git 60 | 61 | `You can add upstream as a remote repo and origin as your fork repo` 62 | 63 | ----------------------- 64 | Installing dependencies 65 | ----------------------- 66 | 67 | All the project dependencies are listed in `requirements.txt` file located in the root directory. To install all the dependencies of the project, simply run: 68 | 69 | .. code-block:: bash 70 | 71 | $ pip install -r requirements.txt 72 | 73 | 74 | 75 | ----------------------------- 76 | Setting up configuration file 77 | ----------------------------- 78 | You will need to setup config values, for that you need to get some values from Polarion and provide it to the config file. For more detail, check out project's `README.md `_ 79 | 80 | ---------------------------- 81 | Install the project with pip 82 | ---------------------------- 83 | `Pylero` supports command line interface. Simply run `pylero` on you terminal, it will prompt to the command line interface. However, before you can do that you will have to install the project by running: 84 | 85 | .. code-block:: bash 86 | 87 | $ pip install . 88 | 89 | in your project root directory. With that, you're ready to submit your first contribution. 90 | 91 | 92 | How to contribute to Pylero 93 | =========================== 94 | There are many ways to contribute to `Pylero`. You can start from reporting issues, raising discussion, submitting bug fixes, adding new features, or updating the documentation. You can also browse through `list of issues `_ and look for any issues with the label of `good first issue` or `help wanted`. 95 | 96 | --------------- 97 | Create an issue 98 | --------------- 99 | 100 | To report any bug, please open a new issue `here `_. Remember to provide as much detail as you can including running environment, version of `Pylero` or snippet of the code. 101 | 102 | ------------------------- 103 | Create a discussion topic 104 | ------------------------- 105 | 106 | In addition, you can create a `discussion topic `_. It can be general topics, new ideas, polls, Q&As or awareness raising. 107 | 108 | -------------------------- 109 | Adding new feature/bug fix 110 | -------------------------- 111 | 112 | Before adding new feature, it's recommended to create a discussion topic first. Then you can create a pull request for your new feature linked to the discussion topic. That way it is easier for the maintainer to track what the change is about. 113 | 114 | New proposed features must be conform to coding style/standard (passing pre-commit checks) and must include at least unit tests. You should create a pull request from your fork against an upstream project. A pull request must be properly rebased from upstream `main` branch, include a precise commit messages, and a brief description. 115 | 116 | If you're pushing a bug fix, please link it to the issue related. 117 | 118 | Note: The project uses GitHub action to run the CI/CD, you should be able to check whether the CI passes or fails. Then, you can wait for code reviews from maintainers or fix any errors that do not pass in the pipeline. 119 | 120 | -------------------- 121 | Update documentation 122 | -------------------- 123 | 124 | The other way to contribute to the project is to look for any outdated documentation and submit an update version to reflect the current status. 125 | New added features should also include documentation and a brief how-to. 126 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Red Hat 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include src/pylero/pylero.cfg scripts/pylero 2 | recursive-include src/pylero *.py 3 | -------------------------------------------------------------------------------- /doc/_build/docs: -------------------------------------------------------------------------------- 1 | ../../docs -------------------------------------------------------------------------------- /doc/modules.rst: -------------------------------------------------------------------------------- 1 | pylero 2 | ====== 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | pylero 8 | -------------------------------------------------------------------------------- /doc/pylero.cli.rst: -------------------------------------------------------------------------------- 1 | pylero.cli package 2 | ================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | pylero.cli.cmd module 8 | --------------------- 9 | 10 | .. automodule:: pylero.cli.cmd 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | :special-members: __init__ 15 | 16 | Module contents 17 | --------------- 18 | 19 | .. automodule:: pylero.cli 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | :special-members: __init__ 24 | -------------------------------------------------------------------------------- /docs/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file records the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: be7d50f232978aeb95bf84be17911610 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatQE/pylero/711b367d91116e6957ff69690684337a0ffc5813/docs/.nojekyll -------------------------------------------------------------------------------- /docs/_modules/pylero/activity_comment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.activity_comment — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.activity_comment

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | from pylero.base_polarion import BasePolarion
 40 | from pylero.text import Text
 41 | 
 42 | 
 43 | 
44 | [docs] 45 | class ActivityComment(BasePolarion): 46 | """Object to handle the Polarion WSDL tns3:ActivityComment class 47 | 48 | Attributes: 49 | text (Text) 50 | time_stamp (dateאime) 51 | user_id (string) 52 | """ 53 | 54 | _cls_suds_map = { 55 | "text": {"field_name": "text", "cls": Text}, 56 | "time_stamp": "timeStamp", 57 | "user_id": "userId", 58 | } 59 | _obj_client = "tracker_client" 60 | _obj_struct = "tns3:ActivityComment"
61 | 62 |
63 | 64 |
65 | 66 |
67 |
68 | 113 |
114 |
115 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /docs/_modules/pylero/activity_custom_value.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.activity_custom_value — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.activity_custom_value

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | from pylero.base_polarion import BasePolarion
 40 | 
 41 | 
 42 | 
43 | [docs] 44 | class ActivityCustomValue(BasePolarion): 45 | """Object to handle the Polarion WSDL tns3:ActivityCustomValue class 46 | 47 | Attributes: 48 | values (ArrayOf_xsd_string)""" 49 | 50 | _cls_suds_map = {"values": "values", "uri": "_uri", "_unresolved": "_unresolved"} 51 | _obj_client = "tracker_client" 52 | _obj_struct = "tns3:ActivityCustomValue"
53 | 54 |
55 | 56 |
57 | 58 |
59 |
60 | 105 |
106 |
107 | 115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /docs/_modules/pylero/activity_source.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.activity_source — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.activity_source

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | from pylero.base_polarion import BasePolarion
 40 | 
 41 | 
 42 | 
43 | [docs] 44 | class ActivitySource(BasePolarion): 45 | """Object to handle the Polarion WSDL tns3:ActivitySource class 46 | 47 | Attributes: 48 | activity_source_id (string) 49 | prefix (string) 50 | types (ArrayOf_xsd_string)""" 51 | 52 | _cls_suds_map = { 53 | "activity_source_id": "id", 54 | "prefix": "prefix", 55 | "types": "types", 56 | "uri": "_uri", 57 | "_unresolved": "_unresolved", 58 | } 59 | _obj_client = "tracker_client" 60 | _obj_struct = "tns3:ActivitySource"
61 | 62 |
63 | 64 |
65 | 66 |
67 |
68 | 113 |
114 |
115 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /docs/_modules/pylero/build_test_results.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.build_test_results — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.build_test_results

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | from pylero.base_polarion import BasePolarion
 40 | 
 41 | 
 42 | 
43 | [docs] 44 | class BuildTestResults(BasePolarion): 45 | """Object to handle the Polarion WSDL tns2:BuildTestResults class 46 | 47 | Attributes: 48 | error_count (int) 49 | failure_count (int) 50 | skipped_count (int) 51 | test_count (int)""" 52 | 53 | _cls_suds_map = { 54 | "error_count": "errorCount", 55 | "failure_count": "failureCount", 56 | "skipped_count": "skippedCount", 57 | "test_count": "testCount", 58 | "uri": "_uri", 59 | "_unresolved": "_unresolved", 60 | } 61 | _obj_client = "builder_client" 62 | _obj_struct = "tns2:BuildTestResults"
63 | 64 |
65 | 66 |
67 | 68 |
69 |
70 | 115 |
116 |
117 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /docs/_modules/pylero/custom_field.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.custom_field — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.custom_field

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | from pylero.base_polarion import BasePolarion
 40 | 
 41 | 
 42 | 
43 | [docs] 44 | class CustomField(BasePolarion): 45 | """Object to handle the Polarion WSDL tns3:CustomField class 46 | 47 | Attributes: 48 | key (string) 49 | parent_item_uri (string) 50 | value (anyType)""" 51 | 52 | _cls_suds_map = {"key": "key", "parent_item_uri": "parentItemURI", "value": "value"} 53 | _obj_client = "tracker_client" 54 | _obj_struct = "tns3:CustomField"
55 | 56 |
57 | 58 |
59 | 60 |
61 |
62 | 107 |
108 |
109 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /docs/_modules/pylero/exceptions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.exceptions — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.exceptions

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | 
 40 | 
41 | [docs] 42 | class PyleroLibException(Exception): 43 | pass
44 | 45 |
46 | 47 |
48 | 49 |
50 |
51 | 96 |
97 |
98 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /docs/_modules/pylero/imported_comment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.imported_comment — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.imported_comment

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | from pylero.base_polarion import BasePolarion
 40 | 
 41 | 
 42 | 
43 | [docs] 44 | class ImportedComment(BasePolarion): 45 | """Object to handle the Polarion WSDL tns4:ImportedComment class 46 | 47 | Attributes: 48 | author (string) 49 | created (dateTime) 50 | initials (string)""" 51 | 52 | _cls_suds_map = { 53 | "author": "author", 54 | "created": "created", 55 | "initials": "initials", 56 | "uri": "_uri", 57 | "_unresolved": "_unresolved", 58 | } 59 | _obj_client = "test_management_client" 60 | _obj_struct = "tns4:ImportedComment"
61 | 62 |
63 | 64 |
65 | 66 |
67 |
68 | 113 |
114 |
115 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /docs/_modules/pylero/language_definition.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.language_definition — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.language_definition

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | from pylero.base_polarion import BasePolarion
 40 | 
 41 | 
 42 | 
43 | [docs] 44 | class LanguageDefinition(BasePolarion): 45 | """Object to handle the Polarion WSDL tns3:LanguageDefinition class 46 | 47 | Attributes: 48 | language_definition_id (string) 49 | label (string)""" 50 | 51 | _cls_suds_map = { 52 | "language_definition_id": "id", 53 | "label": "label", 54 | "uri": "_uri", 55 | "_unresolved": "_unresolved", 56 | } 57 | _obj_client = "tracker_client" 58 | _obj_struct = "tns3:LanguageDefinition"
59 | 60 |
61 | 62 |
63 | 64 |
65 |
66 | 111 |
112 |
113 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /docs/_modules/pylero/license_info.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.license_info — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.license_info

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | from pylero.base_polarion import BasePolarion
 40 | 
 41 | 
 42 | 
43 | [docs] 44 | class LicenseInfo(BasePolarion): 45 | """Object to handle the Polarion WSDL tns3:LicenseInfo class 46 | 47 | Attributes: 48 | license (string) 49 | slots (int)""" 50 | 51 | _cls_suds_map = { 52 | "license": "license", 53 | "slots": "slots", 54 | "uri": "_uri", 55 | "_unresolved": "_unresolved", 56 | } 57 | _obj_client = "security_client" 58 | _obj_struct = "tns3:LicenseInfo"
59 | 60 |
61 | 62 |
63 | 64 |
65 |
66 | 111 |
112 |
113 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /docs/_modules/pylero/properties.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.properties — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.properties

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | from pylero.base_polarion import BasePolarion
 40 | 
 41 | 
 42 | 
43 | [docs] 44 | class Properties(BasePolarion): 45 | """Object to handle the Polarion WSDL tns4:Properties class 46 | 47 | Attributes: 48 | property (property)""" 49 | 50 | _cls_suds_map = { 51 | "property": "property", 52 | "uri": "_uri", 53 | "_unresolved": "_unresolved", 54 | } 55 | _obj_client = "builder_client" 56 | _obj_struct = "tns4:Properties"
57 | 58 |
59 | 60 |
61 | 62 |
63 |
64 | 109 |
110 |
111 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /docs/_modules/pylero/property.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.property — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.property

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | from pylero.base_polarion import BasePolarion
 40 | 
 41 | 
 42 | 
43 | [docs] 44 | class Property(BasePolarion): 45 | """Object to handle the Polarion WSDL tns4:property class 46 | 47 | Attributes: 48 | key (string) 49 | value (string)""" 50 | 51 | _cls_suds_map = { 52 | "key": "key", 53 | "value": "value", 54 | "uri": "_uri", 55 | "_unresolved": "_unresolved", 56 | } 57 | _obj_client = "builder_client" 58 | _obj_struct = "tns4:property"
59 | 60 |
61 | 62 |
63 | 64 |
65 |
66 | 111 |
112 |
113 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /docs/_modules/pylero/signature_data.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.signature_data — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.signature_data

 33 | # -*- coding: utf8 -*-
 34 | from __future__ import absolute_import
 35 | from __future__ import division
 36 | from __future__ import print_function
 37 | from __future__ import unicode_literals
 38 | 
 39 | from pylero.base_polarion import BasePolarion
 40 | from pylero.enum_option_id import EnumOptionId
 41 | 
 42 | 
 43 | 
44 | [docs] 45 | class SignatureData(BasePolarion): 46 | """Object to handle the Polarion WSDL tns5:SignatureData class 47 | 48 | Attributes: 49 | target_status_id (string) 50 | verdict (EnumOptionId)""" 51 | 52 | _cls_suds_map = { 53 | "target_status_id": "targetStatusId", 54 | "verdict": {"field_name": "verdict", "cls": EnumOptionId}, 55 | } 56 | _obj_client = "builder_client" 57 | _obj_struct = "tns5:SignatureData"
58 | 59 |
60 | 61 |
62 | 63 |
64 |
65 | 110 |
111 |
112 | 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /docs/_modules/pylero/subterra_uri.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | pylero.subterra_uri — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 | 32 |

Source code for pylero.subterra_uri

 33 | from __future__ import absolute_import
 34 | from __future__ import division
 35 | from __future__ import print_function
 36 | from __future__ import unicode_literals
 37 | 
 38 | from pylero.base_polarion import BasePolarion
 39 | 
 40 | 
 41 | # Unknown what this class object is supposed to do. Will determine during
 42 | # more intensive testing
 43 | 
44 | [docs] 45 | class SubterraURI(BasePolarion): 46 |
47 | [docs] 48 | def __init__(self): 49 | pass
50 |
51 | 52 | 53 | 54 |
55 | [docs] 56 | class ArrayOfSubterraURI(BasePolarion): 57 |
58 | [docs] 59 | def __init__(self): 60 | pass
61 |
62 | 63 |
64 | 65 |
66 | 67 |
68 |
69 | 114 |
115 |
116 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /docs/_sources/modules.rst.txt: -------------------------------------------------------------------------------- 1 | pylero 2 | ====== 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | pylero 8 | -------------------------------------------------------------------------------- /docs/_sources/pylero.cli.rst.txt: -------------------------------------------------------------------------------- 1 | pylero.cli package 2 | ================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | pylero.cli.cmd module 8 | --------------------- 9 | 10 | .. automodule:: pylero.cli.cmd 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | :special-members: __init__ 15 | 16 | Module contents 17 | --------------- 18 | 19 | .. automodule:: pylero.cli 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | :special-members: __init__ 24 | -------------------------------------------------------------------------------- /docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* This file intentionally left blank. */ 2 | -------------------------------------------------------------------------------- /docs/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Base JavaScript utilities for all Sphinx HTML documentation. 3 | */ 4 | "use strict"; 5 | 6 | const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ 7 | "TEXTAREA", 8 | "INPUT", 9 | "SELECT", 10 | "BUTTON", 11 | ]); 12 | 13 | const _ready = (callback) => { 14 | if (document.readyState !== "loading") { 15 | callback(); 16 | } else { 17 | document.addEventListener("DOMContentLoaded", callback); 18 | } 19 | }; 20 | 21 | /** 22 | * Small JavaScript module for the documentation. 23 | */ 24 | const Documentation = { 25 | init: () => { 26 | Documentation.initDomainIndexTable(); 27 | Documentation.initOnKeyListeners(); 28 | }, 29 | 30 | /** 31 | * i18n support 32 | */ 33 | TRANSLATIONS: {}, 34 | PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), 35 | LOCALE: "unknown", 36 | 37 | // gettext and ngettext don't access this so that the functions 38 | // can safely bound to a different name (_ = Documentation.gettext) 39 | gettext: (string) => { 40 | const translated = Documentation.TRANSLATIONS[string]; 41 | switch (typeof translated) { 42 | case "undefined": 43 | return string; // no translation 44 | case "string": 45 | return translated; // translation exists 46 | default: 47 | return translated[0]; // (singular, plural) translation tuple exists 48 | } 49 | }, 50 | 51 | ngettext: (singular, plural, n) => { 52 | const translated = Documentation.TRANSLATIONS[singular]; 53 | if (typeof translated !== "undefined") 54 | return translated[Documentation.PLURAL_EXPR(n)]; 55 | return n === 1 ? singular : plural; 56 | }, 57 | 58 | addTranslations: (catalog) => { 59 | Object.assign(Documentation.TRANSLATIONS, catalog.messages); 60 | Documentation.PLURAL_EXPR = new Function( 61 | "n", 62 | `return (${catalog.plural_expr})` 63 | ); 64 | Documentation.LOCALE = catalog.locale; 65 | }, 66 | 67 | /** 68 | * helper function to focus on search bar 69 | */ 70 | focusSearchBar: () => { 71 | document.querySelectorAll("input[name=q]")[0]?.focus(); 72 | }, 73 | 74 | /** 75 | * Initialise the domain index toggle buttons 76 | */ 77 | initDomainIndexTable: () => { 78 | const toggler = (el) => { 79 | const idNumber = el.id.substr(7); 80 | const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); 81 | if (el.src.substr(-9) === "minus.png") { 82 | el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; 83 | toggledRows.forEach((el) => (el.style.display = "none")); 84 | } else { 85 | el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; 86 | toggledRows.forEach((el) => (el.style.display = "")); 87 | } 88 | }; 89 | 90 | const togglerElements = document.querySelectorAll("img.toggler"); 91 | togglerElements.forEach((el) => 92 | el.addEventListener("click", (event) => toggler(event.currentTarget)) 93 | ); 94 | togglerElements.forEach((el) => (el.style.display = "")); 95 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); 96 | }, 97 | 98 | initOnKeyListeners: () => { 99 | // only install a listener if it is really needed 100 | if ( 101 | !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && 102 | !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS 103 | ) 104 | return; 105 | 106 | document.addEventListener("keydown", (event) => { 107 | // bail for input elements 108 | if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; 109 | // bail with special keys 110 | if (event.altKey || event.ctrlKey || event.metaKey) return; 111 | 112 | if (!event.shiftKey) { 113 | switch (event.key) { 114 | case "ArrowLeft": 115 | if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; 116 | 117 | const prevLink = document.querySelector('link[rel="prev"]'); 118 | if (prevLink && prevLink.href) { 119 | window.location.href = prevLink.href; 120 | event.preventDefault(); 121 | } 122 | break; 123 | case "ArrowRight": 124 | if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; 125 | 126 | const nextLink = document.querySelector('link[rel="next"]'); 127 | if (nextLink && nextLink.href) { 128 | window.location.href = nextLink.href; 129 | event.preventDefault(); 130 | } 131 | break; 132 | } 133 | } 134 | 135 | // some keyboard layouts may need Shift to get / 136 | switch (event.key) { 137 | case "/": 138 | if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; 139 | Documentation.focusSearchBar(); 140 | event.preventDefault(); 141 | } 142 | }); 143 | }, 144 | }; 145 | 146 | // quick alias for translations 147 | const _ = Documentation.gettext; 148 | 149 | _ready(Documentation.init); 150 | -------------------------------------------------------------------------------- /docs/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | const DOCUMENTATION_OPTIONS = { 2 | VERSION: '', 3 | LANGUAGE: 'en', 4 | COLLAPSE_INDEX: false, 5 | BUILDER: 'html', 6 | FILE_SUFFIX: '.html', 7 | LINK_SUFFIX: '.html', 8 | HAS_SOURCE: true, 9 | SOURCELINK_SUFFIX: '.txt', 10 | NAVIGATION_WITH_KEYS: false, 11 | SHOW_SEARCH_SUMMARY: true, 12 | ENABLE_SEARCH_SHORTCUTS: true, 13 | }; -------------------------------------------------------------------------------- /docs/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatQE/pylero/711b367d91116e6957ff69690684337a0ffc5813/docs/_static/file.png -------------------------------------------------------------------------------- /docs/_static/language_data.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This script contains the language-specific data used by searchtools.js, 3 | * namely the list of stopwords, stemmer, scorer and splitter. 4 | */ 5 | 6 | var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; 7 | 8 | 9 | /* Non-minified version is copied as a separate JS file, if available */ 10 | 11 | /** 12 | * Porter Stemmer 13 | */ 14 | var Stemmer = function() { 15 | 16 | var step2list = { 17 | ational: 'ate', 18 | tional: 'tion', 19 | enci: 'ence', 20 | anci: 'ance', 21 | izer: 'ize', 22 | bli: 'ble', 23 | alli: 'al', 24 | entli: 'ent', 25 | eli: 'e', 26 | ousli: 'ous', 27 | ization: 'ize', 28 | ation: 'ate', 29 | ator: 'ate', 30 | alism: 'al', 31 | iveness: 'ive', 32 | fulness: 'ful', 33 | ousness: 'ous', 34 | aliti: 'al', 35 | iviti: 'ive', 36 | biliti: 'ble', 37 | logi: 'log' 38 | }; 39 | 40 | var step3list = { 41 | icate: 'ic', 42 | ative: '', 43 | alize: 'al', 44 | iciti: 'ic', 45 | ical: 'ic', 46 | ful: '', 47 | ness: '' 48 | }; 49 | 50 | var c = "[^aeiou]"; // consonant 51 | var v = "[aeiouy]"; // vowel 52 | var C = c + "[^aeiouy]*"; // consonant sequence 53 | var V = v + "[aeiou]*"; // vowel sequence 54 | 55 | var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 56 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 57 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 58 | var s_v = "^(" + C + ")?" + v; // vowel in stem 59 | 60 | this.stemWord = function (w) { 61 | var stem; 62 | var suffix; 63 | var firstch; 64 | var origword = w; 65 | 66 | if (w.length < 3) 67 | return w; 68 | 69 | var re; 70 | var re2; 71 | var re3; 72 | var re4; 73 | 74 | firstch = w.substr(0,1); 75 | if (firstch == "y") 76 | w = firstch.toUpperCase() + w.substr(1); 77 | 78 | // Step 1a 79 | re = /^(.+?)(ss|i)es$/; 80 | re2 = /^(.+?)([^s])s$/; 81 | 82 | if (re.test(w)) 83 | w = w.replace(re,"$1$2"); 84 | else if (re2.test(w)) 85 | w = w.replace(re2,"$1$2"); 86 | 87 | // Step 1b 88 | re = /^(.+?)eed$/; 89 | re2 = /^(.+?)(ed|ing)$/; 90 | if (re.test(w)) { 91 | var fp = re.exec(w); 92 | re = new RegExp(mgr0); 93 | if (re.test(fp[1])) { 94 | re = /.$/; 95 | w = w.replace(re,""); 96 | } 97 | } 98 | else if (re2.test(w)) { 99 | var fp = re2.exec(w); 100 | stem = fp[1]; 101 | re2 = new RegExp(s_v); 102 | if (re2.test(stem)) { 103 | w = stem; 104 | re2 = /(at|bl|iz)$/; 105 | re3 = new RegExp("([^aeiouylsz])\\1$"); 106 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 107 | if (re2.test(w)) 108 | w = w + "e"; 109 | else if (re3.test(w)) { 110 | re = /.$/; 111 | w = w.replace(re,""); 112 | } 113 | else if (re4.test(w)) 114 | w = w + "e"; 115 | } 116 | } 117 | 118 | // Step 1c 119 | re = /^(.+?)y$/; 120 | if (re.test(w)) { 121 | var fp = re.exec(w); 122 | stem = fp[1]; 123 | re = new RegExp(s_v); 124 | if (re.test(stem)) 125 | w = stem + "i"; 126 | } 127 | 128 | // Step 2 129 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 130 | if (re.test(w)) { 131 | var fp = re.exec(w); 132 | stem = fp[1]; 133 | suffix = fp[2]; 134 | re = new RegExp(mgr0); 135 | if (re.test(stem)) 136 | w = stem + step2list[suffix]; 137 | } 138 | 139 | // Step 3 140 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 141 | if (re.test(w)) { 142 | var fp = re.exec(w); 143 | stem = fp[1]; 144 | suffix = fp[2]; 145 | re = new RegExp(mgr0); 146 | if (re.test(stem)) 147 | w = stem + step3list[suffix]; 148 | } 149 | 150 | // Step 4 151 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 152 | re2 = /^(.+?)(s|t)(ion)$/; 153 | if (re.test(w)) { 154 | var fp = re.exec(w); 155 | stem = fp[1]; 156 | re = new RegExp(mgr1); 157 | if (re.test(stem)) 158 | w = stem; 159 | } 160 | else if (re2.test(w)) { 161 | var fp = re2.exec(w); 162 | stem = fp[1] + fp[2]; 163 | re2 = new RegExp(mgr1); 164 | if (re2.test(stem)) 165 | w = stem; 166 | } 167 | 168 | // Step 5 169 | re = /^(.+?)e$/; 170 | if (re.test(w)) { 171 | var fp = re.exec(w); 172 | stem = fp[1]; 173 | re = new RegExp(mgr1); 174 | re2 = new RegExp(meq1); 175 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 176 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) 177 | w = stem; 178 | } 179 | re = /ll$/; 180 | re2 = new RegExp(mgr1); 181 | if (re.test(w) && re2.test(w)) { 182 | re = /.$/; 183 | w = w.replace(re,""); 184 | } 185 | 186 | // and turn initial Y back to y 187 | if (firstch == "y") 188 | w = firstch.toLowerCase() + w.substr(1); 189 | return w; 190 | } 191 | } 192 | 193 | -------------------------------------------------------------------------------- /docs/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatQE/pylero/711b367d91116e6957ff69690684337a0ffc5813/docs/_static/minus.png -------------------------------------------------------------------------------- /docs/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatQE/pylero/711b367d91116e6957ff69690684337a0ffc5813/docs/_static/plus.png -------------------------------------------------------------------------------- /docs/_static/pygments.css: -------------------------------------------------------------------------------- 1 | pre { line-height: 125%; } 2 | td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } 3 | span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } 4 | td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } 5 | span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } 6 | .highlight .hll { background-color: #ffffcc } 7 | .highlight { background: #eeffcc; } 8 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 9 | .highlight .err { border: 1px solid #F00 } /* Error */ 10 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 11 | .highlight .o { color: #666 } /* Operator */ 12 | .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ 13 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 14 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 15 | .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ 16 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 17 | .highlight .cs { color: #408090; background-color: #FFF0F0 } /* Comment.Special */ 18 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 19 | .highlight .ge { font-style: italic } /* Generic.Emph */ 20 | .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ 21 | .highlight .gr { color: #F00 } /* Generic.Error */ 22 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 23 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 24 | .highlight .go { color: #333 } /* Generic.Output */ 25 | .highlight .gp { color: #C65D09; font-weight: bold } /* Generic.Prompt */ 26 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 27 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 28 | .highlight .gt { color: #04D } /* Generic.Traceback */ 29 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 30 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 31 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 32 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 33 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 34 | .highlight .kt { color: #902000 } /* Keyword.Type */ 35 | .highlight .m { color: #208050 } /* Literal.Number */ 36 | .highlight .s { color: #4070A0 } /* Literal.String */ 37 | .highlight .na { color: #4070A0 } /* Name.Attribute */ 38 | .highlight .nb { color: #007020 } /* Name.Builtin */ 39 | .highlight .nc { color: #0E84B5; font-weight: bold } /* Name.Class */ 40 | .highlight .no { color: #60ADD5 } /* Name.Constant */ 41 | .highlight .nd { color: #555; font-weight: bold } /* Name.Decorator */ 42 | .highlight .ni { color: #D55537; font-weight: bold } /* Name.Entity */ 43 | .highlight .ne { color: #007020 } /* Name.Exception */ 44 | .highlight .nf { color: #06287E } /* Name.Function */ 45 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 46 | .highlight .nn { color: #0E84B5; font-weight: bold } /* Name.Namespace */ 47 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 48 | .highlight .nv { color: #BB60D5 } /* Name.Variable */ 49 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 50 | .highlight .w { color: #BBB } /* Text.Whitespace */ 51 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 52 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 53 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 54 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 55 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 56 | .highlight .sa { color: #4070A0 } /* Literal.String.Affix */ 57 | .highlight .sb { color: #4070A0 } /* Literal.String.Backtick */ 58 | .highlight .sc { color: #4070A0 } /* Literal.String.Char */ 59 | .highlight .dl { color: #4070A0 } /* Literal.String.Delimiter */ 60 | .highlight .sd { color: #4070A0; font-style: italic } /* Literal.String.Doc */ 61 | .highlight .s2 { color: #4070A0 } /* Literal.String.Double */ 62 | .highlight .se { color: #4070A0; font-weight: bold } /* Literal.String.Escape */ 63 | .highlight .sh { color: #4070A0 } /* Literal.String.Heredoc */ 64 | .highlight .si { color: #70A0D0; font-style: italic } /* Literal.String.Interpol */ 65 | .highlight .sx { color: #C65D09 } /* Literal.String.Other */ 66 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 67 | .highlight .s1 { color: #4070A0 } /* Literal.String.Single */ 68 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 69 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 70 | .highlight .fm { color: #06287E } /* Name.Function.Magic */ 71 | .highlight .vc { color: #BB60D5 } /* Name.Variable.Class */ 72 | .highlight .vg { color: #BB60D5 } /* Name.Variable.Global */ 73 | .highlight .vi { color: #BB60D5 } /* Name.Variable.Instance */ 74 | .highlight .vm { color: #BB60D5 } /* Name.Variable.Magic */ 75 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatQE/pylero/711b367d91116e6957ff69690684337a0ffc5813/docs/objects.inv -------------------------------------------------------------------------------- /docs/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Search — pylero documentation 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 |
35 | 36 | 37 |
38 | 39 |

Search

40 | 41 | 49 | 50 | 51 |

52 | Searching for multiple words only shows matches that contain 53 | all words. 54 |

55 | 56 | 57 |
58 | 59 | 60 | 61 |
62 | 63 | 64 |
65 | 66 | 67 |
68 | 69 |
70 |
71 | 104 |
105 |
106 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /gen_docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Temporary until CI is setup to build documentation dynamically 3 | 4 | # Use this script to generate documentataion locally, run './gen_docs.sh -h' 5 | # from root of the directory for more info 6 | 7 | # Backoff from any failure 8 | set -euo pipefail 9 | 10 | trap 'handle_error $? $LINENO' EXIT 11 | 12 | handle_error(){ 13 | if [ "$1" != "0" ]; then 14 | printf "Cleanup of any failures\n" 15 | printf "Error %s occured on %s, cleaning docs if generated\n" "$1" "$2" 16 | if [[ $(pwd) =~ doc$ ]]; then 17 | make clean 18 | else 19 | rm -rf _build/* 20 | fi 21 | if [[ $(pwd) =~ pylero$ ]]; then 22 | make clean -C doc/ 23 | else 24 | rm -rf doc/_build/* 25 | fi 26 | fi 27 | } 28 | 29 | usage() 30 | { 31 | echo 32 | echo "Generate documentation using Sphinx locally and remove 'username(-n)'," 33 | echo "'url(-u)', 'project(-p)' reference from docs" 34 | echo 35 | echo "Usage: ./gen_docs.sh [options]" 36 | echo "options:" 37 | echo " n Name of the Polarion user." 38 | echo " u URL of Polarion local instance." 39 | echo " p Project of Polarion local instance." 40 | echo " h Print this help." 41 | echo 42 | } 43 | 44 | if [[ $# -eq 0 ]] ; then 45 | usage 1>&2 46 | exit 1 47 | fi 48 | 49 | # Install sphinx if not installed 50 | if ! command -v sphinx-build 1>/dev/null; then 51 | echo "'sphinx-build' is required but not found in PATH, do you wish to install (Sphinx v3.4.3) via Pip?" 52 | select yn in "Yes" "No"; do 53 | case $yn in 54 | Yes ) pip install sphinx==3.4.3; break;; 55 | No ) echo "Can't procced without sphinx-build"; exit 1;; 56 | esac 57 | done 58 | fi 59 | 60 | options=":n:u:p:h" 61 | name="" 62 | url="" 63 | project="" 64 | 65 | while getopts $options opt; do 66 | case ${opt} in 67 | n ) 68 | name=$OPTARG 69 | ;; 70 | u ) 71 | url=$OPTARG 72 | ;; 73 | p ) 74 | project=$OPTARG 75 | ;; 76 | h ) 77 | usage 78 | exit;; 79 | \? ) 80 | printf "\nInvalid Option: -%s\n" "$OPTARG" 1>&2 81 | usage 1>&2 82 | exit;; 83 | : ) 84 | printf "\nInvalid option: %s requires an argument\n" "$OPTARG" 1>&2 85 | usage 1>&2 86 | exit;; 87 | esac 88 | done 89 | 90 | shift $((OPTIND -1)) 91 | if [ -z "$name" ] || [ -z "$url" ] || [ -z "$project" ]; then 92 | printf "\nMissing -n or -u or -p\n" 1>&2 93 | usage 1>&2 94 | exit 1 95 | fi 96 | 97 | # Copy Pylero configuration file to doc directory 98 | [ -e "$HOME"/.pylero ] && cp "$HOME"/.pylero .pylero 99 | [ -e .pylero ] && cp .pylero doc/.pylero 100 | 101 | # Generate documentaion 102 | cd doc/ 103 | make clean 104 | make html 105 | cd - 1>/dev/null 106 | 107 | # Replace all internal references 108 | build_dir="doc/_build/html" 109 | rm -rf doc/_build/doctrees 110 | echo 111 | echo Reference of "'$name'" will be changed to 'POLARION_USERNAME' in below files 112 | grep -riln "$name" $build_dir | tee /dev/tty | xargs sed -i "s|$name|POLARION_USERNAME|gi" 113 | 114 | echo 115 | echo Reference of "'$url'" will be changed to 'POLARION_URL' in below files 116 | if grep -riln "$url" $build_dir; then 117 | grep -riln "$url" $build_dir | tee /dev/tty | xargs sed -i "s|$url|POLARION_URL|gi" 118 | fi 119 | 120 | echo 121 | echo Reference of "'$project'" will be changed to 'POLARION_PROJECT' in below files 122 | grep -riln "$project" $build_dir | tee /dev/tty | xargs sed -i "s|$project|POLARION_PROJECT|gi" 123 | 124 | echo 125 | 126 | # Need to have 'docs' folder for serving from github pages 127 | rm -rf docs 128 | shopt -s dotglob; mv -f $build_dir docs 129 | ln -fsvr docs "doc/_build/" 130 | touch docs/.nojekyll 131 | echo "Done! Docs can be served from 'docs' folder" 132 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=45", "setuptools_scm", "wheel"] 3 | -------------------------------------------------------------------------------- /python-pylero.spec: -------------------------------------------------------------------------------- 1 | Name: python-pylero 2 | Version: 0.1.1 3 | Release: 1%{?dist} 4 | Summary: Python SDK for Polarion 5 | 6 | License: MIT 7 | URL: https://github.com/RedHatQE/pylero 8 | Source: %{url}/archive/%{version}/pylero-%{version}.tar.gz 9 | 10 | BuildArch: noarch 11 | BuildRequires: python3-devel 12 | 13 | %global _description %{expand: 14 | This is Pylero, the Python wrapper for the Polarion WSDL API. The Pylero 15 | wrapper enables native python access to Polarion objects and functionality 16 | using object oriented structure and functionality. This allows the devlopers to 17 | use Pylero in a natural fashion without being concerned about the Polarion 18 | details. 19 | 20 | All Pylero objects inherit from BasePolarion. The objects used in the library 21 | are all generated from the SOAP factory class, using the python-suds library. 22 | The Pylero class attributes are generated dynamically as properties, based on 23 | a mapping dict between the pylero naming convention and the Polarion attribute 24 | names. 25 | 26 | The use of properties allows the pylero object attributes to be virtual with no 27 | need for syncing between them and the Polarion objects they are based on. 28 | 29 | The Polarion WSDL API does not implement validation/verification of data passed 30 | in, so the Pylero library takes care of this itself. All enums are validated 31 | before being sent to the server and raise an error if not using a valid value. 32 | A number of workflow implementations are also included, for example when 33 | creating a Document, it automatically creates the Heading work item at the same 34 | time. 35 | 36 | Polarion Work Items are configured per installation, to give native workitem 37 | objects (such as TestCase), the library connects to the Polarion server, 38 | downloads the list of workitems and creates them.} 39 | 40 | %description %_description 41 | 42 | %package -n python3-pylero 43 | Summary: %{summary} 44 | 45 | %description -n python3-pylero %_description 46 | 47 | 48 | %prep 49 | %autosetup -p1 -n pylero-%{version} 50 | 51 | 52 | %generate_buildrequires 53 | %pyproject_buildrequires 54 | 55 | 56 | %build 57 | %pyproject_wheel 58 | 59 | 60 | %install 61 | %pyproject_install 62 | 63 | %pyproject_save_files pylero 64 | 65 | 66 | %global _pylero_import_exclude %{expand: 67 | -e pylero.build -e pylero.build_linked_work_item -e pylero.cli.cmd -e pylero.document 68 | -e pylero.plan -e pylero.plan_record -e pylero.test_record -e pylero.test_run 69 | -e pylero.work_item 70 | } 71 | 72 | %check 73 | # If the Polarion server URL is not specified in config some libraries will 74 | # fail to import, so exclude the modules which require the server url 75 | %pyproject_check_import %_pylero_import_exclude 76 | 77 | 78 | %files -n python3-pylero -f %{pyproject_files} 79 | %doc README.md 80 | %{_bindir}/pylero 81 | %{_bindir}/pylero-cmd 82 | 83 | 84 | %changelog 85 | * Fri May 30 2025 Wayne Sun 0.1.1-1 86 | - Update doc to latest (gsun@redhat.com) 87 | - Add python 3.13 in support list (gsun@redhat.com) 88 | - chore(test_run): run pre-commit hooks (konstantin.althaus.ext@vaillant- 89 | group.com) 90 | - fix(test_run): consistent use of create_incident 91 | (konstantin.althaus.ext@vaillant-group.com) 92 | - Automatic commit of package [python-pylero] release [0.1.0-1]. 93 | (gsun@redhat.com) 94 | - Update doc to latest (gsun@redhat.com) 95 | 96 | * Mon May 20 2024 Wayne Sun 0.1.0-1 97 | - feat: add flag for incident creation (konstantin.althaus.ext@vaillant- 98 | group.com) 99 | - refactor: safely import test case workitem type 100 | (konstantin.althaus.ext@vaillant-group.com) 101 | - fix: catch exceptions, avoid empty tables (konstantin.althaus.ext@vaillant- 102 | group.com) 103 | - refactor: auxiliary functions become methods 104 | (konstantin.althaus.ext@vaillant-group.com) 105 | - feat: add dummy TestCase class (konstantin.althaus.ext@vaillant-group.com) 106 | - fix: add project_id to _WorkItem (konstantin.althaus.ext@vaillant-group.com) 107 | - Adding methods that get document revision/s (emesika@redhat.com) 108 | - fix: erase title only for subcomments 109 | (45875998+AlthausKonstantin@users.noreply.github.com) 110 | - Feat/link external workitmes (#176) 111 | (45875998+AlthausKonstantin@users.noreply.github.com) 112 | 113 | * Tue Mar 05 2024 Wayne Sun 114 | - Remove Python 3.6 and add 3.12 115 | - Bug fix and doc update 116 | 117 | * Tue Mar 14 2023 Wayne Sun 0.0.8-1 118 | - Add token config support 119 | 120 | * Thu Feb 23 2023 Wayne Sun 0.0.7-1 121 | - Remove platform related info 122 | 123 | * Fri Feb 17 2023 Wayne Sun 0.0.6-1 124 | - Update suds dependency for CentOS Stream 125 | - Rebuilt doc to latest (gsun@redhat.com) 126 | 127 | * Wed Dec 21 2022 Wayne Sun 0.0.5-1 128 | - Rename spec to python-pylero 129 | - Bug fixes 130 | 131 | * Tue Sep 13 2022 Wayne Sun 0.0.4-1 132 | - Fix EPEL9 yum suds package (gsun@redhat.com) 133 | - Switch back to modern rpm spec (gsun@redhat.com) 134 | - Using modern pypi package build system interface (gsun@redhat.com) 135 | - Fix the config file path (gsun@redhat.com) 136 | - Update contact and copyright info (gsun@redhat.com) 137 | - Code style update (gsun@redhat.com) 138 | - Remove the sample config file in data_files (gsun@redhat.com) 139 | - Update spec with improvement (gsun@redhat.com) 140 | - use cft.multi while parsing array custom fields (lgangava@redhat.com) 141 | - Fix testrun search method params with limit (gsun@redhat.com) 142 | 143 | * Tue Aug 02 2022 Wayne Sun 0.0.3-1 144 | - new package built with tito 145 | - Switch from suds-py3 to suds 146 | - Downgrade to 201x python rpm build spec 147 | - Remove rpm build action 148 | - Add Fedora rpm build section 149 | 150 | * Mon May 23 2022 Wayne Sun - 0.0.2-1 151 | - Initial packaging 152 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | suds 2 | click 3 | readline; python_version <= '3.6' 4 | -------------------------------------------------------------------------------- /scripts/pylero: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import inspect 3 | import os 4 | import pkgutil 5 | import sys 6 | 7 | import pylero 8 | 9 | # On import, the (gnu/)readline features are active without calling 10 | # any functions. This enables the arrow keys. Without this 11 | # import, pressing the arrow keys shows ctrl chars. 12 | if sys.version_info > (3, 6): 13 | try: 14 | import gnureadline as readline 15 | except ImportError: 16 | # `readline` is deprecated and `gnureadline` requires `Python.h` and 17 | # `ncurses-devel` packages. TODO: Furnish steps to install `gnureadline` 18 | pass 19 | else: 20 | # `readline` on python > 3.6 resulting in Traceback at times 21 | import readline 22 | 23 | USAGE = """\ 24 | Welcome to Pylero, the Python wrapper for the Polarion WSDL API. The Pylero 25 | wrapper enables native python access to Polarion objects and functionality 26 | using object oriented structure and functionality. This allows the developers to 27 | use Pylero in a natural fashion without being concerned about the Polarion 28 | details. 29 | 30 | A configuration file must be filled out, which must be located either in the 31 | current dir (the dir where the script is executed from) named **.pylero** or in 32 | the user's home dir ~/.pylero 33 | 34 | Default settings are stored in LIBDIR/pylero.cfg. This file should not 35 | be modified, as it will be overwritten with any future updates. Certificates 36 | should be verified automatically, but if they aren't, you can add the path to 37 | your CA to the cert_path config option. These are the configurable values: 38 | 39 | [webservice] 40 | url=https://{your polarion web URL}/polarion 41 | svn_repo=https://{your polarion web URL}/repo 42 | user={your username} 43 | password={your password} 44 | default_project={your default project} 45 | #cert_path=/dir/with/certs 46 | #disable_manual_auth=False 47 | 48 | If the password value is blank, it will prompt you for a password when you try 49 | to access any of the pylero objects. 50 | 51 | These can also be overridden with the following environment variables: 52 | POLARION_URL 53 | POLARION_REPO 54 | POLARION_USERNAME 55 | POLARION_PASSWORD 56 | POLARION_TIMEOUT 57 | POLARION_PROJECT 58 | POLARION_CERT_PATH 59 | POLARION_DISABLE_MANUAL_AUTH 60 | """ 61 | 62 | 63 | def parse_args(): 64 | if len(sys.argv) == 2 and sys.argv[1] in ("-h", "--help"): 65 | print(USAGE) 66 | sys.exit(0) 67 | 68 | 69 | def main(): 70 | EXCLUDE_MODULES = ["test_classes", "embedding", "interface", "server", "session"] 71 | _class_names = [] 72 | for lstmods in pkgutil.iter_modules([pylero.__path__[0]]): 73 | the_mod = lstmods[1] 74 | if the_mod not in EXCLUDE_MODULES: 75 | imp_mod = __import__("pylero.{0}".format(the_mod), fromlist=[""]) 76 | for cls in inspect.getmembers(imp_mod, inspect.isclass): 77 | globals()[cls[0]] = cls[1] 78 | if cls[0] not in _class_names: 79 | _class_names.append(cls[0]) 80 | _class_names.sort() 81 | 82 | 83 | if __name__ == "__main__": 84 | parse_args() 85 | main() 86 | os.environ["PYTHONINSPECT"] = "yes" 87 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from setuptools import setup 4 | 5 | with open("README.md", "r") as handle: 6 | LONG_DESCRIPTION = handle.read() 7 | 8 | PACKAGE_NAME = "pylero" 9 | CLI_NAME = "pylero-cmd" 10 | RELEASE_FILE = "/etc/system-release-cpe" 11 | 12 | install_requires_ = ["click", "suds"] 13 | 14 | if __name__ == "__main__": 15 | setup( 16 | name=PACKAGE_NAME, 17 | version="0.1.1", 18 | description="Python SDK for Polarion", 19 | long_description=LONG_DESCRIPTION, 20 | long_description_content_type="text/markdown", 21 | url="https://github.com/RedHatQE/pylero", 22 | author="%s Developers" % PACKAGE_NAME, 23 | author_email="dno-tools@redhat.com", 24 | license="MIT", 25 | package_dir={ 26 | PACKAGE_NAME: "src/%s" % PACKAGE_NAME, 27 | }, 28 | packages=[ 29 | PACKAGE_NAME, 30 | PACKAGE_NAME + ".cli", 31 | ], 32 | include_package_data=True, 33 | scripts=[ 34 | "scripts/%s" % PACKAGE_NAME, 35 | "scripts/%s" % CLI_NAME, 36 | ], 37 | install_requires=install_requires_, 38 | classifiers=[ 39 | "Development Status :: 5 - Production/Stable", # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package 40 | "Intended Audience :: Developers", # Define that your audience are developers 41 | "Topic :: Software Development :: Build Tools", 42 | "License :: OSI Approved :: MIT License", # Again, pick a license 43 | "Programming Language :: Python :: 3", # Specify which pyhton versions that you want to support 44 | "Programming Language :: Python :: 3.8", 45 | "Programming Language :: Python :: 3.9", 46 | "Programming Language :: Python :: 3.10", 47 | "Programming Language :: Python :: 3.11", 48 | "Programming Language :: Python :: 3.12", 49 | "Programming Language :: Python :: 3.13", 50 | ], 51 | ) 52 | -------------------------------------------------------------------------------- /src/pylero/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | """Pylero is a Python wrapper for the Polarion WSDL API. It implements the 8 | API in a native Python object oriented approach, using objects to wrap like 9 | functionality. 10 | """ 11 | -------------------------------------------------------------------------------- /src/pylero/_compatible.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | """ 3 | _compatible.py 4 | 5 | This is a compatibility module that assists on keeping the pylero 6 | Library compatible with python 2.x and python 3.x. 7 | """ 8 | 9 | try: 10 | import __builtin__ as builtins 11 | except ImportError: 12 | import builtins 13 | 14 | try: 15 | from builtins import object 16 | except ImportError: 17 | from __builtin__ import object 18 | 19 | try: 20 | from builtins import classmethod 21 | except ImportError: 22 | from __builtin__ import classmethod 23 | 24 | try: 25 | from builtins import range 26 | except ImportError: 27 | from __builtin__ import range 28 | 29 | try: 30 | from builtins import str 31 | except ImportError: 32 | from __builtin__ import str 33 | 34 | try: 35 | string_types = (str, unicode) 36 | except NameError: 37 | string_types = (str,) 38 | 39 | try: 40 | from __builtin__ import basestring 41 | except ImportError: 42 | basestring = (str, bytes) 43 | 44 | try: 45 | from urlparse import urlparse 46 | except ImportError: 47 | from urllib.parse import urlparse 48 | 49 | try: 50 | from ConfigParser import ConfigParser 51 | except ImportError: 52 | from configparser import ConfigParser 53 | -------------------------------------------------------------------------------- /src/pylero/activity.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.text import Text 9 | 10 | 11 | class Activity(BasePolarion): 12 | """Object to handle the Polarion WSDL tns3:Activity class 13 | 14 | Attributes: 15 | activity_custom_values (list of ActivityCustomValueEntry) 16 | comments (list of ActivityComment) 17 | context_id (ContextId) 18 | global_id (string) 19 | activity_id (string) 20 | info (Text) 21 | prefix (string) 22 | resource_locations (list) 23 | source_id (string) 24 | timestamp (dateTime) 25 | type (string) 26 | user_id (string)""" 27 | 28 | _cls_suds_map = { 29 | "activity_custom_values": "activity_custom_values", 30 | "comments": "comments", # array of ActivityComment 31 | "global_id": "globalId", 32 | "activity_id": "id", 33 | "info": {"field_name": "info", "cls": Text}, 34 | "prefix": "prefix", 35 | "resource_locations": "resourceLocations", 36 | "source_id": "sourceId", 37 | "timestamp": "timestamp", 38 | "type": "type", 39 | "user_id": "userId", 40 | "uri": "_uri", 41 | "_unresolved": "_unresolved", 42 | } 43 | _obj_client = "tracker_client" 44 | _obj_struct = "tns3:Activity" 45 | -------------------------------------------------------------------------------- /src/pylero/activity_comment.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.text import Text 9 | 10 | 11 | class ActivityComment(BasePolarion): 12 | """Object to handle the Polarion WSDL tns3:ActivityComment class 13 | 14 | Attributes: 15 | text (Text) 16 | time_stamp (dateאime) 17 | user_id (string) 18 | """ 19 | 20 | _cls_suds_map = { 21 | "text": {"field_name": "text", "cls": Text}, 22 | "time_stamp": "timeStamp", 23 | "user_id": "userId", 24 | } 25 | _obj_client = "tracker_client" 26 | _obj_struct = "tns3:ActivityComment" 27 | -------------------------------------------------------------------------------- /src/pylero/activity_custom_value.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class ActivityCustomValue(BasePolarion): 11 | """Object to handle the Polarion WSDL tns3:ActivityCustomValue class 12 | 13 | Attributes: 14 | values (ArrayOf_xsd_string)""" 15 | 16 | _cls_suds_map = {"values": "values", "uri": "_uri", "_unresolved": "_unresolved"} 17 | _obj_client = "tracker_client" 18 | _obj_struct = "tns3:ActivityCustomValue" 19 | -------------------------------------------------------------------------------- /src/pylero/activity_custom_value_entry.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.activity_custom_value import ActivityCustomValue 8 | from pylero.base_polarion import BasePolarion 9 | 10 | 11 | class ActivityCustomValueEntry(BasePolarion): 12 | """Object to handle the Polarion WSDL tns3:ActivityCustomValueEntry class 13 | 14 | Attributes: 15 | custom_values (ActivityCustomValue) 16 | key (string)""" 17 | 18 | _cls_suds_map = { 19 | "custom_values": {"field_name": "customValues", "cls": ActivityCustomValue}, 20 | "key": "key", 21 | "uri": "_uri", 22 | "_unresolved": "_unresolved", 23 | } 24 | _obj_client = "tracker_client" 25 | _obj_struct = "tns3:ActivityCustomValueEntry" 26 | -------------------------------------------------------------------------------- /src/pylero/activity_source.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class ActivitySource(BasePolarion): 11 | """Object to handle the Polarion WSDL tns3:ActivitySource class 12 | 13 | Attributes: 14 | activity_source_id (string) 15 | prefix (string) 16 | types (ArrayOf_xsd_string)""" 17 | 18 | _cls_suds_map = { 19 | "activity_source_id": "id", 20 | "prefix": "prefix", 21 | "types": "types", 22 | "uri": "_uri", 23 | "_unresolved": "_unresolved", 24 | } 25 | _obj_client = "tracker_client" 26 | _obj_struct = "tns3:ActivitySource" 27 | -------------------------------------------------------------------------------- /src/pylero/approval.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | from pylero.user import User 10 | 11 | 12 | class Approval(BasePolarion): 13 | """Object to handle the Polarion WSDL tns5:Approval class 14 | 15 | Attributes: 16 | status (EnumOptionId) 17 | user (User)""" 18 | 19 | _cls_suds_map = { 20 | "status": { 21 | "field_name": "status", 22 | "cls": EnumOptionId, 23 | "enum_id": "approval-status", 24 | }, 25 | "user_id": {"field_name": "user", "cls": User}, 26 | "uri": "_uri", 27 | "_unresolved": "_unresolved", 28 | } 29 | _obj_client = "builder_client" 30 | _obj_struct = "tns5:Approval" 31 | 32 | 33 | class ArrayOfApproval(BasePolarion): 34 | _obj_client = "builder_client" 35 | _obj_struct = "tns5:ArrayOfApproval" 36 | -------------------------------------------------------------------------------- /src/pylero/attachment.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.user import User 9 | 10 | 11 | class Attachment(BasePolarion): 12 | """Object to handle the Polarion WSDL tns5:Attachment class 13 | 14 | Attributes: 15 | author (User) 16 | file_name (string) 17 | attachment_id (string) 18 | length (long) 19 | title (string) 20 | updated (dateTime) 21 | url (string)""" 22 | 23 | _cls_suds_map = { 24 | "author": {"field_name": "author", "cls": User}, 25 | "file_name": "fileName", 26 | "attachment_id": "id", 27 | "length": "length", 28 | "title": "title", 29 | "updated": "updated", 30 | "url": "url", 31 | "uri": "_uri", 32 | "_unresolved": "_unresolved", 33 | } 34 | _obj_client = "builder_client" 35 | _obj_struct = "tns5:Attachment" 36 | 37 | 38 | class ArrayOfAttachment(BasePolarion): 39 | _obj_client = "builder_client" 40 | _obj_struct = "tns5:ArrayOfAttachment" 41 | -------------------------------------------------------------------------------- /src/pylero/baseline.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.project import Project 9 | from pylero.user import User 10 | 11 | 12 | class Baseline(BasePolarion): 13 | """Object to handle the Polarion WSDL tns3:Baseline class 14 | 15 | Attributes: 16 | author (User) 17 | base_revision (string) 18 | description (string) 19 | baseline_id (string) 20 | name (string) 21 | project (Project)""" 22 | 23 | _cls_suds_map = { 24 | "author": {"field_name": "author", "cls": User}, 25 | "base_revision": "baseRevision", 26 | "description": "description", 27 | "baseline_id": "id", 28 | "name": "name", 29 | "project": {"field_name": "project", "cls": Project}, 30 | "uri": "_uri", 31 | "_unresolved": "_unresolved", 32 | } 33 | _obj_client = "tracker_client" 34 | _obj_struct = "tns3:Baseline" 35 | 36 | @classmethod 37 | def create(cls, project_id, name, description, revision): 38 | """class method create Creates a Baseline from head or particular 39 | revision. 40 | 41 | Args: 42 | project_id 43 | name: baseline name (not None) 44 | description: baseline description (can be None) 45 | revision: revision or null value for head revision 46 | 47 | Returns: 48 | Baseline object 49 | 50 | References: 51 | Tracker.createBaseline 52 | """ 53 | suds_object = cls.session.tracker_client.service.createBaseline( 54 | project_id, name, description, revision 55 | ) 56 | return cls(suds_object=suds_object) 57 | 58 | @classmethod 59 | def query(cls, query, sort="baseline_id"): 60 | """Queries for baselines. 61 | 62 | Args: 63 | query: the lucene query to be used. 64 | sort: the field to be used for sorting. 65 | 66 | Returns: 67 | list of Baselines 68 | 69 | References: 70 | Tracker.queryBaselines 71 | """ 72 | baselines = [] 73 | for suds_base in cls.session.tracker_client.service.queryBaselines(query, sort): 74 | baselines.append(Baseline(suds_object=suds_base)) 75 | return baselines 76 | -------------------------------------------------------------------------------- /src/pylero/build.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.build_linked_work_item import ArrayOfBuildLinkedWorkItem 9 | from pylero.build_linked_work_item import BuildLinkedWorkItem 10 | from pylero.build_test_results import BuildTestResults 11 | from pylero.user import User 12 | 13 | 14 | class Build(BasePolarion): 15 | """Object to handle the Polarion WSDL tns2:Build class 16 | 17 | Attributes: 18 | author (User) 19 | bir_location (Location) 20 | build_descriptor_name (string) 21 | build_stamp (string) 22 | build_status (string) 23 | build_tag (string) 24 | build_test_results (BuildTestResults) 25 | calculation_descriptor_name (string) 26 | creation_time (dateTime) 27 | finish_time (dateTime) 28 | build_id (string) 29 | job_id (string) 30 | linked_work_items (ArrayOfBuildLinkedWorkItem) 31 | local_deployment_space_name (string) 32 | log_files (ArrayOfLocation) 33 | start_time (dateTime)""" 34 | 35 | _cls_suds_map = { 36 | "author": {"field_name": "author", "cls": User}, 37 | "bir_location": "birLocation", 38 | "build_descriptor_name": "buildDescriptorName", 39 | "build_stamp": "buildStamp", 40 | "build_status": "buildStatus", 41 | "build_tag": "buildTag", 42 | "build_test_results": { 43 | "field_name": "buildTestResults", 44 | "cls": BuildTestResults, 45 | }, 46 | "calculation_descriptor_name": "calculationDescriptorName", 47 | "creation_time": "creationTime", 48 | "finish_time": "finishTime", 49 | "build_id": "id", 50 | "job_id": "jobId", 51 | "linked_work_items": { 52 | "field_name": "linkedWorkItems", 53 | "is_array": True, 54 | "cls": BuildLinkedWorkItem, 55 | "arr_cls": ArrayOfBuildLinkedWorkItem, 56 | "inner_field_name": "BuildLinkedWorkItem", 57 | }, 58 | "local_deployment_space_name": "localDeploymentSpaceName", 59 | "log_files": "logFiles", 60 | "start_time": "startTime", 61 | "uri": "_uri", 62 | "_unresolved": "_unresolved", 63 | } 64 | _obj_client = "builder_client" 65 | _obj_struct = "tns2:Build" 66 | -------------------------------------------------------------------------------- /src/pylero/build_linked_work_item.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | from pylero.work_item import _WorkItem 10 | 11 | 12 | class BuildLinkedWorkItem(BasePolarion): 13 | """Object to handle the Polarion WSDL tns2:BuildLinkedWorkItem class 14 | 15 | Attributes: 16 | revision (string) 17 | role (EnumOptionId) 18 | work_item (WorkItem)""" 19 | 20 | _cls_suds_map = { 21 | "revision": "revision", 22 | "role": { 23 | "field_name": "role", 24 | "cls": EnumOptionId, 25 | "enum_id": "workitem-link-role", 26 | }, 27 | "work_item": {"field_name": "workItem", "cls": _WorkItem}, 28 | "uri": "_uri", 29 | "_unresolved": "_unresolved", 30 | } 31 | _obj_client = "builder_client" 32 | _obj_struct = "tns2:BuildLinkedWorkItem" 33 | 34 | 35 | class ArrayOfBuildLinkedWorkItem(BasePolarion): 36 | _obj_client = "builder_client" 37 | _obj_struct = "tns2:ArrayOfBuildLinkedWorkItem" 38 | -------------------------------------------------------------------------------- /src/pylero/build_test_results.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class BuildTestResults(BasePolarion): 11 | """Object to handle the Polarion WSDL tns2:BuildTestResults class 12 | 13 | Attributes: 14 | error_count (int) 15 | failure_count (int) 16 | skipped_count (int) 17 | test_count (int)""" 18 | 19 | _cls_suds_map = { 20 | "error_count": "errorCount", 21 | "failure_count": "failureCount", 22 | "skipped_count": "skippedCount", 23 | "test_count": "testCount", 24 | "uri": "_uri", 25 | "_unresolved": "_unresolved", 26 | } 27 | _obj_client = "builder_client" 28 | _obj_struct = "tns2:BuildTestResults" 29 | -------------------------------------------------------------------------------- /src/pylero/category.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.text import Text 9 | 10 | 11 | class Category(BasePolarion): 12 | """Object to handle the Polarion WSDL tns5:Category class 13 | 14 | Attributes: 15 | description (Text) 16 | category_id (string) 17 | name (string)""" 18 | 19 | _cls_suds_map = { 20 | "description": {"field_name": "description", "cls": Text}, 21 | "category_id": "id", 22 | "name": "name", 23 | "uri": "_uri", 24 | "_unresolved": "_unresolved", 25 | } 26 | _obj_client = "builder_client" 27 | _obj_struct = "tns5:Category" 28 | _id_field = "category_id" 29 | 30 | 31 | class ArrayOfCategory(BasePolarion): 32 | _obj_client = "builder_client" 33 | _obj_struct = "tns5:ArrayOfCategory" 34 | -------------------------------------------------------------------------------- /src/pylero/change.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class Change(BasePolarion): 11 | """Object to handle the Polarion WSDL tns3:Change class 12 | 13 | Attributes: 14 | creation (boolean) 15 | date (dateTime) 16 | diffs (ArrayOf_tns3_FieldDiff) 17 | empty (boolean) 18 | invalid (boolean) 19 | revision (string) 20 | user (string) 21 | """ 22 | 23 | _cls_suds_map = { 24 | "creation": "creation", 25 | "date": "date", 26 | "diffs": "diffs", 27 | "empty": "empty", 28 | "invalid": "invalid", 29 | "revision": "revision", 30 | "user": "user", 31 | "uri": "_uri", 32 | "_unresolved": "_unresolved", 33 | } 34 | _obj_client = "tracker_client" 35 | _obj_struct = "tns3:Change" 36 | -------------------------------------------------------------------------------- /src/pylero/cli/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatQE/pylero/711b367d91116e6957ff69690684337a0ffc5813/src/pylero/cli/__init__.py -------------------------------------------------------------------------------- /src/pylero/comment.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import ArrayOfEnumOptionId 9 | from pylero.enum_option_id import EnumOptionId 10 | from pylero.signature_data import SignatureData 11 | from pylero.subterra_uri import ArrayOfSubterraURI 12 | from pylero.subterra_uri import SubterraURI 13 | from pylero.text import Text 14 | from pylero.user import User 15 | 16 | 17 | class Comment(BasePolarion): 18 | """Object to handle the Polarion WSDL tns5:Comment class 19 | 20 | Attributes: 21 | author (User) 22 | child_comment_uris (ArrayOfSubterraURI) 23 | created (dateTime) 24 | comment_id (string) 25 | parent_comment_uri (SubterraURI) 26 | resolved (boolean) 27 | signature_data (SignatureData) 28 | tags (ArrayOfEnumOptionId) 29 | text (Text) 30 | title (string) 31 | visible_to (ArrayOfstring) 32 | """ 33 | 34 | _cls_suds_map = { 35 | "author": {"field_name": "author", "cls": User}, 36 | "child_comment_uris": { 37 | "field_name": "childCommentURIs", 38 | "is_array": True, 39 | "cls": SubterraURI, 40 | "arr_cls": ArrayOfSubterraURI, 41 | "inner_field_name": "SubterraURI", 42 | }, 43 | "created": "created", 44 | "comment_id": "id", 45 | "parent_comment_uri": {"field_name": "parentCommentURI", "cls": SubterraURI}, 46 | "resolved": "resolved", 47 | "signature_data": {"field_name": "signatureData", "cls": SignatureData}, 48 | "tags": { 49 | "field_name": "tags", 50 | "is_array": True, 51 | "cls": EnumOptionId, 52 | "arr_cls": ArrayOfEnumOptionId, 53 | "inner_field_name": "EnumOptionId", 54 | }, 55 | "text": {"field_name": "text", "cls": Text}, 56 | "title": "title", 57 | "visible_to": "visibleTo", 58 | "uri": "_uri", 59 | "_unresolved": "_unresolved", 60 | } 61 | _obj_client = "builder_client" 62 | _obj_struct = "tns5:Comment" 63 | 64 | 65 | class ArrayOfComment(BasePolarion): 66 | _obj_client = "builder_client" 67 | _obj_struct = "tns5:ArrayOfComment" 68 | -------------------------------------------------------------------------------- /src/pylero/custom.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | 10 | 11 | class Custom(BasePolarion): 12 | """Object to manage Polarion TestManagement WS tns4:Custom 13 | 14 | Attributes: 15 | key (string) 16 | value (EnumOptionId)""" 17 | 18 | _cls_suds_map = { 19 | "key": "key", 20 | "value": {"field_name": "value", "cls": EnumOptionId}, 21 | } 22 | _obj_client = "test_management_client" 23 | _obj_struct = "tns4:Custom" 24 | 25 | def __init__(self, key=None, value=None, suds_object=None): 26 | super(self.__class__, self).__init__(None, suds_object) 27 | if key: 28 | self.key = key 29 | self.value = value 30 | 31 | 32 | class ArrayOfCustom(BasePolarion): 33 | _obj_client = "test_management_client" 34 | _obj_struct = "tns4:ArrayOfCustom" 35 | -------------------------------------------------------------------------------- /src/pylero/custom_field.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class CustomField(BasePolarion): 11 | """Object to handle the Polarion WSDL tns3:CustomField class 12 | 13 | Attributes: 14 | key (string) 15 | parent_item_uri (string) 16 | value (anyType)""" 17 | 18 | _cls_suds_map = {"key": "key", "parent_item_uri": "parentItemURI", "value": "value"} 19 | _obj_client = "tracker_client" 20 | _obj_struct = "tns3:CustomField" 21 | -------------------------------------------------------------------------------- /src/pylero/custom_field_type.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class CustomFieldType(BasePolarion): 11 | """Object to handle the Polarion WSDL tns5:CustomFieldType class 12 | 13 | Attributes: 14 | default_value (anyType) 15 | depends_on (string) 16 | description (string) 17 | cft_id (string) 18 | name (string) 19 | required (boolean) 20 | type (string) 21 | """ 22 | 23 | # id field is called cft_id and not custom_field_type_id because it is often 24 | # mixed with enum_custom_field_type and they need to be accessed 25 | # interchangeably 26 | _cls_suds_map = { 27 | "default_value": "defaultValue", 28 | "depends_on": "dependsOn", 29 | "description": "description", 30 | "cft_id": "id", 31 | "name": "name", 32 | "multi": "multi", 33 | "required": "required", 34 | "type": "type", 35 | "uri": "_uri", 36 | "_unresolved": "_unresolved", 37 | } 38 | _obj_client = "builder_client" 39 | _obj_struct = "tns5:CustomFieldType" 40 | -------------------------------------------------------------------------------- /src/pylero/enum_custom_field_type.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class EnumCustomFieldType(BasePolarion): 11 | """Object to handle the Polarion WSDL tns5:EnumCustomFieldType class 12 | 13 | Attributes: 14 | default_value (anyType) 15 | depends_on (string) 16 | description (string) 17 | enum_id (string) 18 | id (string) 19 | name (string) 20 | required (boolean) 21 | type (string)""" 22 | 23 | # id field is called cft_id and not enum_custom_field_type_id because it is 24 | # often mixed with custom_field_type and they need to be accessed 25 | # interchangeably 26 | _cls_suds_map = { 27 | "default_value": "defaultValue", 28 | "depends_on": "dependsOn", 29 | "description": "description", 30 | "enum_id": "enumId", 31 | "cft_id": "id", 32 | "name": "name", 33 | "multi": "multi", 34 | "required": "required", 35 | "type": "type", 36 | "uri": "_uri", 37 | "_unresolved": "_unresolved", 38 | } 39 | _obj_client = "builder_client" 40 | _obj_struct = "tns5:EnumCustomFieldType" 41 | -------------------------------------------------------------------------------- /src/pylero/enum_option.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.properties import Properties 9 | 10 | 11 | class EnumOption(BasePolarion): 12 | """Object to handle the Polarion WSDL tns5:EnumOption class 13 | 14 | Attributes: 15 | default (boolean) 16 | enum_id (string) 17 | hidden (boolean) 18 | enum_option_id (string) 19 | name (string) 20 | phantom (boolean) 21 | properties (Properties) 22 | sequence_number (int)""" 23 | 24 | _cls_suds_map = { 25 | "default": "default", 26 | "enum_id": "enumId", 27 | "hidden": "hidden", 28 | "enum_option_id": "id", 29 | "name": "name", 30 | "phantom": "phantom", 31 | "properties": {"field_name": "properties", "cls": Properties}, 32 | "sequence_number": "sequenceNumber", 33 | "uri": "_uri", 34 | "_unresolved": "_unresolved", 35 | } 36 | _obj_client = "builder_client" 37 | _obj_struct = "tns5:EnumOption" 38 | -------------------------------------------------------------------------------- /src/pylero/enum_option_id.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class EnumOptionId(BasePolarion): 11 | """An object to manage Polarion TestManagement tns4:EnumOptionId""" 12 | 13 | _cls_suds_map = {"enum_id": "id"} 14 | _id_field = "enum_id" 15 | _obj_client = "test_management_client" 16 | _obj_struct = "tns4:EnumOptionId" 17 | 18 | def __init__(self, enum_id=None, suds_object=None): 19 | super(EnumOptionId, self).__init__(enum_id, suds_object) 20 | 21 | 22 | class ArrayOfEnumOptionId(BasePolarion): 23 | """An object to manage Polarion TestManagement tns4:ArrayOfEnumOptionId""" 24 | 25 | _obj_client = "test_management_client" 26 | _obj_struct = "tns4:ArrayOfEnumOptionId" 27 | _cls_inner = EnumOptionId 28 | -------------------------------------------------------------------------------- /src/pylero/exceptions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | 8 | class PyleroLibException(Exception): 9 | pass 10 | -------------------------------------------------------------------------------- /src/pylero/externally_linked_work_item.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | 10 | 11 | class ExternallyLinkedWorkItem(BasePolarion): 12 | """Object to handle the Polarion WSDL tns5:ExternallyLinkedWorkItem class 13 | 14 | Attributes: 15 | role (EnumOptionId) 16 | work_item_uri (string)""" 17 | 18 | _cls_suds_map = { 19 | "role": { 20 | "field_name": "role", 21 | "cls": EnumOptionId, 22 | "enum_id": "workitem-link-role", 23 | }, 24 | "work_item_id": { # cls is added in _fix_circular_refs function 25 | "field_name": "workItemURI", 26 | "named_arg": "uri", 27 | "sync_field": "uri", 28 | }, 29 | } 30 | _obj_client = "builder_client" 31 | _obj_struct = "tns5:ExternallyLinkedWorkItem" 32 | _id_field = "work_item_id" 33 | 34 | def __init__(self, project_id=None, work_item_id=None, suds_object=None): 35 | self.project_id = project_id if project_id else self.default_project 36 | super(self.__class__, self).__init__(work_item_id, suds_object) 37 | 38 | def _fix_circular_refs(self): 39 | # need to import WorkItem, but this module is used by WorkItem. 40 | # need to pass in the project_id parm to the Work Item, 41 | # but it is not given before instantiation 42 | from pylero.work_item import _WorkItem 43 | 44 | self._cls_suds_map["work_item_id"]["cls"] = _WorkItem 45 | self._cls_suds_map["work_item_id"]["additional_parms"] = { 46 | "project_id": self.project_id 47 | } 48 | 49 | 50 | class ArrayOfExternallyLinkedWorkItem(BasePolarion): 51 | _obj_client = "builder_client" 52 | _obj_struct = "tns5:ArrayOfExternallyLinkedWorkItem" 53 | -------------------------------------------------------------------------------- /src/pylero/field_diff.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class FieldDiff(BasePolarion): 11 | """Object to handle the Polarion WSDL tns3:FieldDiff class 12 | 13 | Attributes: 14 | added (ArrayOf_xsd_anyType) 15 | after (anyType) 16 | before (anyType) 17 | collection (boolean) 18 | field_name (string) 19 | removed (ArrayOf_xsd_anyType)""" 20 | 21 | _cls_suds_map = { 22 | "added": "added", 23 | "after": "after", 24 | "before": "before", 25 | "collection": "collection", 26 | "field_name": "fieldName", 27 | "removed": "removed", 28 | "uri": "_uri", 29 | "_unresolved": "_unresolved", 30 | } 31 | _obj_client = "tracker_client" 32 | _obj_struct = "tns3:FieldDiff" 33 | -------------------------------------------------------------------------------- /src/pylero/hyperlink.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | 10 | 11 | class Hyperlink(BasePolarion): 12 | """Object to handle the Polarion WSDL tns5:Hyperlink class 13 | 14 | Attributes: 15 | role (EnumOptionId) 16 | uri (string)""" 17 | 18 | _cls_suds_map = { 19 | "role": { 20 | "field_name": "role", 21 | "cls": EnumOptionId, 22 | "enum_id": "hyperlink-role", 23 | }, 24 | "uri": "uri", 25 | } 26 | _obj_client = "builder_client" 27 | _obj_struct = "tns5:Hyperlink" 28 | 29 | 30 | class ArrayOfHyperlink(BasePolarion): 31 | _obj_client = "builder_client" 32 | _obj_struct = "tns5:ArrayOfHyperlink" 33 | -------------------------------------------------------------------------------- /src/pylero/imported_comment.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class ImportedComment(BasePolarion): 11 | """Object to handle the Polarion WSDL tns4:ImportedComment class 12 | 13 | Attributes: 14 | author (string) 15 | created (dateTime) 16 | initials (string)""" 17 | 18 | _cls_suds_map = { 19 | "author": "author", 20 | "created": "created", 21 | "initials": "initials", 22 | "uri": "_uri", 23 | "_unresolved": "_unresolved", 24 | } 25 | _obj_client = "test_management_client" 26 | _obj_struct = "tns4:ImportedComment" 27 | -------------------------------------------------------------------------------- /src/pylero/language_definition.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class LanguageDefinition(BasePolarion): 11 | """Object to handle the Polarion WSDL tns3:LanguageDefinition class 12 | 13 | Attributes: 14 | language_definition_id (string) 15 | label (string)""" 16 | 17 | _cls_suds_map = { 18 | "language_definition_id": "id", 19 | "label": "label", 20 | "uri": "_uri", 21 | "_unresolved": "_unresolved", 22 | } 23 | _obj_client = "tracker_client" 24 | _obj_struct = "tns3:LanguageDefinition" 25 | -------------------------------------------------------------------------------- /src/pylero/license_info.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class LicenseInfo(BasePolarion): 11 | """Object to handle the Polarion WSDL tns3:LicenseInfo class 12 | 13 | Attributes: 14 | license (string) 15 | slots (int)""" 16 | 17 | _cls_suds_map = { 18 | "license": "license", 19 | "slots": "slots", 20 | "uri": "_uri", 21 | "_unresolved": "_unresolved", 22 | } 23 | _obj_client = "security_client" 24 | _obj_struct = "tns3:LicenseInfo" 25 | -------------------------------------------------------------------------------- /src/pylero/linked_work_item.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | 10 | 11 | class LinkedWorkItem(BasePolarion): 12 | """Object to handle the Polarion WSDL tns5:LinkedWorkItem class 13 | 14 | Attributes: 15 | revision (string) 16 | role (EnumOptionId) 17 | suspect (boolean) 18 | work_item_id (string)""" 19 | 20 | _cls_suds_map = { 21 | "revision": "revision", 22 | "role": { 23 | "field_name": "role", 24 | "cls": EnumOptionId, 25 | "enum_id": "workitem-link-role", 26 | }, 27 | "suspect": "suspect", 28 | "work_item_id": { # class added in _fix_circular_refs function 29 | "field_name": "workItemURI", 30 | "named_arg": "uri", 31 | "sync_field": "uri", 32 | }, 33 | } 34 | _obj_client = "builder_client" 35 | _obj_struct = "tns5:LinkedWorkItem" 36 | _id_field = "work_item_id" 37 | 38 | def __init__(self, project_id=None, work_item_id=None, suds_object=None): 39 | self.project_id = project_id if project_id else self.default_project 40 | super(self.__class__, self).__init__(work_item_id, suds_object) 41 | 42 | def _fix_circular_refs(self): 43 | # need to import WorkItem, but this module is used by WorkItem. 44 | # need to pass in the project_id parm to the Work Item, 45 | # but it is not given before instantiation 46 | from pylero.work_item import _WorkItem 47 | 48 | self._cls_suds_map["work_item_id"]["cls"] = _WorkItem 49 | self._cls_suds_map["work_item_id"]["additional_parms"] = { 50 | "project_id": self.project_id 51 | } 52 | 53 | 54 | class ArrayOfLinkedWorkItem(BasePolarion): 55 | _obj_client = "builder_client" 56 | _obj_struct = "tns5:ArrayOfLinkedWorkItem" 57 | -------------------------------------------------------------------------------- /src/pylero/module_comment.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import ArrayOfEnumOptionId 9 | from pylero.enum_option_id import EnumOptionId 10 | from pylero.imported_comment import ImportedComment 11 | from pylero.signature_data import SignatureData 12 | from pylero.subterra_uri import ArrayOfSubterraURI 13 | from pylero.subterra_uri import SubterraURI 14 | from pylero.text import Text 15 | from pylero.user import User 16 | 17 | 18 | class ModuleComment(BasePolarion): 19 | """Object to handle the Polarion WSDL tns4:ModuleComment class 20 | 21 | Attributes: 22 | author (User) 23 | child_comment_uris (ArrayOfSubterraURI) 24 | created (dateTime) 25 | module_comment_id (string) 26 | imported_comment (ImportedComment) 27 | parent_comment_uri (SubterraURI) 28 | referred_work_item_uri (SubterraURI) 29 | resolved (boolean) 30 | signature_data (SignatureData) 31 | tags (ArrayOfEnumOptionId) 32 | text (Text)""" 33 | 34 | _cls_suds_map = { 35 | "author": {"field_name": "author", "cls": User}, 36 | "child_comment_uris": { 37 | "field_name": "childCommentURIs", 38 | "is_array": True, 39 | "cls": SubterraURI, 40 | "arr_cls": ArrayOfSubterraURI, 41 | "inner_field_name": "SubterraURI", 42 | }, 43 | "created": "created", 44 | "module_comment_id": "id", 45 | "imported_comment": {"field_name": "importedComment", "cls": ImportedComment}, 46 | "parent_comment_uri": {"field_name": "parentCommentURI", "cls": SubterraURI}, 47 | "referred_work_item_uri": { 48 | "field_name": "referredWorkItemURI", 49 | "cls": SubterraURI, 50 | }, 51 | "resolved": "resolved", 52 | "signature_data": {"field_name": "signatureData", "cls": SignatureData}, 53 | "tags": { 54 | "field_name": "tags", 55 | "is_array": True, 56 | "cls": EnumOptionId, 57 | "arr_cls": ArrayOfEnumOptionId, 58 | "inner_field_name": "EnumOptionId", 59 | }, 60 | "text": {"field_name": "text", "cls": Text}, 61 | "uri": "_uri", 62 | "_unresolved": "_unresolved", 63 | } 64 | _obj_client = "test_management_client" 65 | _obj_struct = "tns4:ModuleComment" 66 | 67 | 68 | class ArrayOfModuleComment(BasePolarion): 69 | _obj_client = "test_management_client" 70 | _obj_struct = "tns4:ArrayOfModuleComment" 71 | -------------------------------------------------------------------------------- /src/pylero/plan_record.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.work_item import _WorkItem 9 | 10 | 11 | class PlanRecord(BasePolarion): 12 | """Object to handle the Polarion WSDL tns6:PlanRecord class 13 | 14 | Attributes: 15 | item (_WorkItem)""" 16 | 17 | _cls_suds_map = { 18 | "item": {"field_name": "item", "cls": _WorkItem}, 19 | "uri": "_uri", 20 | "_unresolved": "_unresolved", 21 | } 22 | _obj_client = "builder_client" 23 | _obj_struct = "tns6:PlanRecord" 24 | 25 | 26 | class ArrayOfPlanRecord(BasePolarion): 27 | _obj_client = "builder_client" 28 | _obj_struct = "tns6:ArrayOfPlanRecord" 29 | -------------------------------------------------------------------------------- /src/pylero/plan_statistics.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class PlanStatistics(BasePolarion): 11 | """Object to handle the Polarion WSDL tns3:PlanStatistics class 12 | 13 | Attributes: 14 | done (float) 15 | done_as_string (string) 16 | ideal_progress (float) 17 | ideal_progress_as_string (string) 18 | number_of_planned (int) 19 | number_of_resolved (int) 20 | number_of_unresolved (int) 21 | planned (float) 22 | planned_as_string (string) 23 | progress (float) 24 | progress_as_string (string) 25 | todo (float) 26 | todo_as_string (string)""" 27 | 28 | _cls_suds_map = { 29 | "done": "done", 30 | "done_as_string": "doneAsString", 31 | "ideal_progress": "idealProgress", 32 | "ideal_progress_as_string": "idealProgressAsString", 33 | "number_of_planned": "numberOfPlanned", 34 | "number_of_resolved": "numberOfResolved", 35 | "number_of_unresolved": "numberOfUnresolved", 36 | "planned": "planned", 37 | "planned_as_string": "plannedAsString", 38 | "progress": "progress", 39 | "progress_as_string": "progressAsString", 40 | "todo": "todo", 41 | "todo_as_string": "todoAsString", 42 | "uri": "_uri", 43 | "_unresolved": "_unresolved", 44 | } 45 | _obj_client = "planning_client" 46 | _obj_struct = "tns3:PlanStatistics" 47 | -------------------------------------------------------------------------------- /src/pylero/planning_constraint.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | 10 | 11 | class PlanningConstraint(BasePolarion): 12 | """Object to handle the Polarion WSDL tns5:PlanningConstraint class 13 | 14 | Attributes: 15 | constraint (EnumOptionId) 16 | date (dateTime)""" 17 | 18 | _cls_suds_map = { 19 | "constraint": {"field_name": "constraint", "cls": EnumOptionId}, 20 | "date": "date", 21 | "uri": "_uri", 22 | "_unresolved": "_unresolved", 23 | } 24 | _obj_client = "builder_client" 25 | _obj_struct = "tns5:PlanningConstraint" 26 | 27 | 28 | class ArrayOfPlanningConstraint(BasePolarion): 29 | _obj_client = "builder_client" 30 | _obj_struct = "tns5:ArrayOfPlanningConstraint" 31 | -------------------------------------------------------------------------------- /src/pylero/priority_opt.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.properties import Properties 9 | 10 | 11 | class PriorityOpt(BasePolarion): 12 | """Object to handle the Polarion WSDL tns5:PriorityOpt class 13 | 14 | Attributes: 15 | default (boolean) 16 | enum_id (string) 17 | float (float) 18 | hidden (boolean) 19 | priority_opt_id (string) 20 | name (string) 21 | phantom (boolean) 22 | properties (Properties) 23 | sequence_number (int)""" 24 | 25 | _cls_suds_map = { 26 | "default": "default", 27 | "enum_id": "enumId", 28 | "float": "float", 29 | "hidden": "hidden", 30 | "priority_opt_id": "id", 31 | "name": "name", 32 | "phantom": "phantom", 33 | "properties": {"field_name": "properties", "cls": Properties}, 34 | "sequence_number": "sequenceNumber", 35 | "uri": "_uri", 36 | "_unresolved": "_unresolved", 37 | } 38 | _obj_client = "builder_client" 39 | _obj_struct = "tns5:PriorityOpt" 40 | -------------------------------------------------------------------------------- /src/pylero/priority_option_id.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class PriorityOptionId(BasePolarion): 11 | """Object to handle the Polarion WSDL tns5:PriorityOptionId class 12 | 13 | Attributes: 14 | id (string)""" 15 | 16 | _cls_suds_map = {"id": "id", "uri": "_uri", "_unresolved": "_unresolved"} 17 | _id_field = "id" 18 | _obj_client = "builder_client" 19 | _obj_struct = "tns5:PriorityOptionId" 20 | 21 | def __init__(self, id=None, uri=None, suds_object=None): 22 | """PriorityOptionID Constructor 23 | 24 | Args: 25 | id: value of the priority 26 | uri: the SubterraURI of the priority 27 | suds_object: the Polarion Plan object 28 | 29 | Returns: 30 | None 31 | 32 | References: 33 | _WorkItem.priority 34 | """ 35 | super(self.__class__, self).__init__(id, suds_object) 36 | 37 | 38 | class ArrayOfPriorityOptionId(BasePolarion): 39 | _obj_client = "builder_client" 40 | _obj_struct = "tns5:ArrayOfPriorityOptionId" 41 | -------------------------------------------------------------------------------- /src/pylero/product_license.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | # Array of License Info is listed as: ArrayOf_tns3_LicenseInfo 11 | class ProductLicense(BasePolarion): 12 | """Object to handle the Polarion WSDL tns3:ProductLicense class 13 | 14 | Attributes: 15 | concurrent_license_data (ArrayOf_tns3_LicenseInfo) 16 | customer_company (string) 17 | customer_email (string) 18 | customer_name (string) 19 | date_created (dateTime) 20 | expiration_date (dateTime) 21 | generated_by (string) 22 | ip_address (string) 23 | license_format (string) 24 | license_profile (string) 25 | mac_address (string) 26 | named_license_data (ArrayOf_tns3_LicenseInfo)""" 27 | 28 | _cls_suds_map = { 29 | "concurrent_license_data": "concurrent_license_data", 30 | "customer_company": "customerCompany", 31 | "customer_email": "customerEmail", 32 | "customer_name": "customerName", 33 | "date_created": "dateCreated", 34 | "expiration_date": "expirationDate", 35 | "generated_by": "generatedBy", 36 | "ip_address": "ipAddress", 37 | "license_format": "licenseFormat", 38 | "license_profile": "licenseProfile", 39 | "mac_address": "macAddress", 40 | "named_license_data": "named_license_data", 41 | "uri": "_uri", 42 | "_unresolved": "_unresolved", 43 | } 44 | _obj_client = "security_client" 45 | _obj_struct = "tns3:ProductLicense" 46 | -------------------------------------------------------------------------------- /src/pylero/project_group.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.project import Project 9 | from pylero.subterra_uri import ArrayOfSubterraURI 10 | from pylero.subterra_uri import SubterraURI 11 | 12 | 13 | class ProjectGroup(BasePolarion): 14 | """Object to handle the Polarion WSDL tns2:ProjectGroup class 15 | 16 | Attributes: 17 | group_uris (ArrayOfSubterraURI) 18 | location (Location) 19 | name (string) 20 | parent_uri (SubterraURI) 21 | project_ids (ArrayOfstring)""" 22 | 23 | _cls_suds_map = { 24 | "group_uris": { 25 | "field_name": "groupURIs", 26 | "is_array": True, 27 | "cls": SubterraURI, 28 | "arr_cls": ArrayOfSubterraURI, 29 | "inner_field_name": "SubterraURI", 30 | }, 31 | "location": "location", 32 | "name": "name", 33 | "parent_uri": {"field_name": "parentURI", "cls": SubterraURI}, 34 | "project_ids": "projectIDs", 35 | "uri": "_uri", 36 | "_unresolved": "_unresolved", 37 | } 38 | _obj_client = "project_client" 39 | _obj_struct = "tns2:ProjectGroup" 40 | 41 | @classmethod 42 | def get_root_project_group(cls): 43 | """Gets the root project group. 44 | 45 | Args: 46 | None 47 | 48 | Returns: 49 | ProjectGroup object 50 | 51 | References: 52 | Project.getRootProjectGroup 53 | """ 54 | return cls(suds_object=cls.session.project_client.service.getRootProjectGroup()) 55 | 56 | def __init__(self, uri=None, location=None, suds_object=None): 57 | """ProjectGroup constructor. 58 | 59 | Args: 60 | uri: the uri that references the Polarion ProjectGroup 61 | location: the location of the Polarion ProjectGroup 62 | suds_object: Polarion ProjectGroup object. When given, the object 63 | is populated by object data. 64 | 65 | Notes: 66 | Either uri or suds_object or location in or none of them. 67 | If none of the identifying parameters are 68 | passed in an empty object is created 69 | 70 | References: 71 | p.Project.getProjectGroup 72 | p.Project.getProjectGroupAtLocation 73 | """ 74 | super(self.__class__, self).__init__(suds_object=suds_object) 75 | if uri: 76 | self._suds_object = self.session.project_client.service.getProjectGroup(uri) 77 | elif location: 78 | self._suds_object = ( 79 | self.session.project_client.service.getProjectGroupAtLocation(location) 80 | ) 81 | 82 | def get_contained_groups(self): 83 | """Gets all project groups located directly below the project group. 84 | 85 | Args: 86 | None 87 | 88 | Returns: 89 | list of p.ProjectGroup objects 90 | 91 | References: 92 | p.Project.getContainedGroups 93 | """ 94 | self._verify_obj() 95 | groups = [] 96 | for suds_group in self.session.project_client.service.getContainedGroups( 97 | self.uri 98 | ): 99 | groups.append(self.__class__(suds_object=suds_group)) 100 | return groups 101 | 102 | def get_contained_projects(self): 103 | """Gets all projects located directly below the project group. 104 | 105 | Args: 106 | None 107 | 108 | Returns: 109 | list of p.Project objects 110 | 111 | References: 112 | p.Project.getContainedProjects 113 | """ 114 | self._verify_obj() 115 | projects = [] 116 | for suds_project in self.session.project_client.service.getContainedProjects( 117 | self.uri 118 | ): 119 | projects.append(Project(suds_object=suds_project)) 120 | return projects 121 | 122 | def get_deep_contained_projects(self): 123 | """Gets all projects located below the project group. 124 | 125 | Args: 126 | None 127 | 128 | Returns: 129 | list of p.Project objects 130 | 131 | References: 132 | p.Project.getDeepContainedProjects 133 | """ 134 | self._verify_obj() 135 | projects = [] 136 | for ( 137 | suds_project 138 | ) in self.session.project_client.service.getDeepContainedProjects(self.uri): 139 | projects.append(Project(suds_object=suds_project)) 140 | return projects 141 | -------------------------------------------------------------------------------- /src/pylero/properties.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class Properties(BasePolarion): 11 | """Object to handle the Polarion WSDL tns4:Properties class 12 | 13 | Attributes: 14 | property (property)""" 15 | 16 | _cls_suds_map = { 17 | "property": "property", 18 | "uri": "_uri", 19 | "_unresolved": "_unresolved", 20 | } 21 | _obj_client = "builder_client" 22 | _obj_struct = "tns4:Properties" 23 | -------------------------------------------------------------------------------- /src/pylero/property.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class Property(BasePolarion): 11 | """Object to handle the Polarion WSDL tns4:property class 12 | 13 | Attributes: 14 | key (string) 15 | value (string)""" 16 | 17 | _cls_suds_map = { 18 | "key": "key", 19 | "value": "value", 20 | "uri": "_uri", 21 | "_unresolved": "_unresolved", 22 | } 23 | _obj_client = "builder_client" 24 | _obj_struct = "tns4:property" 25 | -------------------------------------------------------------------------------- /src/pylero/pylero.cfg: -------------------------------------------------------------------------------- 1 | [webservice] 2 | # This configuration file should not be changed. 3 | # Changes should be made in ~/.pylero or ./.pylero 4 | url= 5 | svn_repo= 6 | user= 7 | password= 8 | token= 9 | default_project= 10 | 11 | # Uncomment the line below if you want to use ssl CA verification 12 | # (make sure 'cert_path' is correct) 13 | 14 | #cert_path=/etc/pki/tls/cert.pem 15 | -------------------------------------------------------------------------------- /src/pylero/revision.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.subterra_uri import ArrayOfSubterraURI 9 | from pylero.subterra_uri import SubterraURI 10 | 11 | 12 | class Revision(BasePolarion): 13 | """Object to handle the Polarion WSDL tns4:Revision class 14 | 15 | Attributes: 16 | author (string) 17 | created (dateTime) 18 | internal_commit (boolean) 19 | linked_work_item_uris (ArrayOfSubterraURI) 20 | message (string) 21 | name (string) 22 | repository_name (string)""" 23 | 24 | _cls_suds_map = { 25 | "author": "author", 26 | "created": "created", 27 | "internal_commit": "internalCommit", 28 | "linked_work_item_uris": { 29 | "field_name": "linkedWorkItemURIs", 30 | "is_array": True, 31 | "cls": SubterraURI, 32 | "arr_cls": ArrayOfSubterraURI, 33 | "inner_field_name": "SubterraURI", 34 | }, 35 | "message": "message", 36 | "name": "name", 37 | "repository_name": "repositoryName", 38 | "uri": "_uri", 39 | "_unresolved": "_unresolved", 40 | } 41 | _obj_client = "builder_client" 42 | _obj_struct = "tns4:Revision" 43 | 44 | @classmethod 45 | def query(cls, query, sort="name", fields=["name"], query_uris=False): 46 | """Searches revisions 47 | 48 | Args: 49 | query: query, Lucene 50 | sort: Lucene sort string, default - name 51 | fields: list of field names to fill in the returned 52 | Revision (can be null). For nested structures in 53 | the lists you can use following syntax to include only 54 | subset of fields: myList.LIST.key 55 | (e.g. linkedWorkItems.LIST.role). 56 | For custom fields you can specify which fields you want to 57 | be filled using following syntax: 58 | customFields.CUSTOM_FIELD_ID (e.g. customFields.risk). 59 | Default - list containing "name" 60 | query_uris: if True, returns a list of URIs instead of Revision 61 | objects. default - False 62 | 63 | Returns: 64 | list of Revisions 65 | 66 | References: 67 | Tracker.queryRevisions 68 | """ 69 | if query_uris: 70 | return cls.session.tracker_client.service.queryRevisionUris( 71 | query, sort, False 72 | ) 73 | else: 74 | revs = cls.session.tracker_client.service.queryRevisions( 75 | query, sort, fields 76 | ) 77 | lst_rev = [Revision(suds_object=rev) for rev in revs] 78 | return lst_rev 79 | 80 | 81 | class ArrayOfRevision(BasePolarion): 82 | _obj_client = "builder_client" 83 | _obj_struct = "tns4:ArrayOfRevision" 84 | -------------------------------------------------------------------------------- /src/pylero/server.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero._compatible import builtins # noqa 8 | from pylero._compatible import object 9 | from pylero.session import Session 10 | 11 | 12 | class Server(object): 13 | """Server object is instantiated once per Polarion session and creates the 14 | session that is used to connect to the server. 15 | """ 16 | 17 | def __init__( 18 | self, 19 | url, 20 | user, 21 | password, 22 | token, 23 | default_project=None, 24 | relogin_timeout=60, 25 | timeout=120, 26 | cert_path=None, 27 | ): 28 | """An object that defines the properties of the Polarion server to 29 | connect to. 30 | 31 | Args: 32 | url: url of the Polarion server 33 | user: username 34 | password: password 35 | default_project: default project to use to for configuarations 36 | relogin_timeout: timeout after which the session will try to login 37 | again 38 | timeout: http tiemout 39 | cert_path: path to customize CA bundle 40 | """ 41 | self.url = url 42 | self.user = user 43 | self.password = password 44 | self.token = token 45 | self.default_project = default_project 46 | self.relogin_timeout = relogin_timeout 47 | self.timeout = timeout 48 | self.cert_path = cert_path 49 | 50 | def session(self): 51 | return Session(self, self.timeout) 52 | -------------------------------------------------------------------------------- /src/pylero/signature.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | from pylero.user import User 10 | 11 | 12 | class Signature(BasePolarion): 13 | """Object to handle the Polarion WSDL tns4:Signature class 14 | 15 | Attributes: 16 | signed_by (User) 17 | signed_revision (string) 18 | signer_role (string) 19 | verdict (EnumOptionId) 20 | verdict_time (dateTime)""" 21 | 22 | _cls_suds_map = { 23 | "verdict": {"field_name": "verdict", "cls": EnumOptionId}, 24 | "signed_revision": "signedRevision", 25 | "verdict_time": "verdictTime", 26 | "signer_role": "signerRole", 27 | "signed_by": {"field_name": "signedBy", "cls": User}, 28 | } 29 | _obj_client = "test_management_client" 30 | _obj_struct = "tns4:Signature" 31 | 32 | 33 | class ArrayOfSignature(BasePolarion): 34 | _obj_client = "test_management_client" 35 | _obj_struct = "tns4:ArrayOfSignature" 36 | -------------------------------------------------------------------------------- /src/pylero/signature_context.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.signature import ArrayOfSignature 9 | from pylero.signature import Signature 10 | from pylero.user import User 11 | 12 | 13 | class SignatureContext(BasePolarion): 14 | """Object to handle the Polarion WSDL tns4:SignatureContext class 15 | 16 | Attributes: 17 | signatures (ArrayOfSignature) 18 | target_status_id (string) 19 | transition_data_revision (string) 20 | user (User)""" 21 | 22 | _cls_suds_map = { 23 | "transition_data_revision": "transitionDataRevision", 24 | "signatures": { 25 | "field_name": "signatures", 26 | "is_array": True, 27 | "cls": Signature, 28 | "arr_cls": ArrayOfSignature, 29 | "inner_field_name": "Signature", 30 | }, 31 | "target_status_id": "targetStatusId", 32 | "user": {"field_name": "user", "cls": User}, 33 | } 34 | _obj_client = "test_management_client" 35 | _obj_struct = "tns4:SignatureContext" 36 | 37 | 38 | class ArrayOfSignatureContext(BasePolarion): 39 | _obj_client = "test_management_client" 40 | _obj_struct = "tns4:ArrayOfSignatureContext" 41 | -------------------------------------------------------------------------------- /src/pylero/signature_data.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | 10 | 11 | class SignatureData(BasePolarion): 12 | """Object to handle the Polarion WSDL tns5:SignatureData class 13 | 14 | Attributes: 15 | target_status_id (string) 16 | verdict (EnumOptionId)""" 17 | 18 | _cls_suds_map = { 19 | "target_status_id": "targetStatusId", 20 | "verdict": {"field_name": "verdict", "cls": EnumOptionId}, 21 | } 22 | _obj_client = "builder_client" 23 | _obj_struct = "tns5:SignatureData" 24 | -------------------------------------------------------------------------------- /src/pylero/subterra_uri.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | 6 | from pylero.base_polarion import BasePolarion 7 | 8 | 9 | # Unknown what this class object is supposed to do. Will determine during 10 | # more intensive testing 11 | class SubterraURI(BasePolarion): 12 | def __init__(self): 13 | pass 14 | 15 | 16 | class ArrayOfSubterraURI(BasePolarion): 17 | def __init__(self): 18 | pass 19 | -------------------------------------------------------------------------------- /src/pylero/test_record.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | from pylero.test_run_attachment import ArrayOfTestRunAttachment 10 | from pylero.test_run_attachment import TestRunAttachment 11 | from pylero.test_step_result import ArrayOfTestStepResult 12 | from pylero.test_step_result import TestStepResult 13 | from pylero.text import Text 14 | from pylero.user import User 15 | from pylero.work_item import _WorkItem 16 | 17 | 18 | class TestRecord(BasePolarion): 19 | """Object to handle the Polarion WSDL tns3:TestRecord class 20 | 21 | Attributes (for specific details, see Polarion): 22 | attachments (ArrayOfTestRunAttachment) 23 | comment (Text) 24 | defect_case_id (string) 25 | duration (float) 26 | executed (dateTime) 27 | executed_by (string) 28 | result (EnumOptionId) 29 | test_case_revision (string) 30 | test_case_id (string) 31 | test_step_results (ArrayOfTestStepResult)""" 32 | 33 | _cls_suds_map = { 34 | "attachments": { 35 | "field_name": "attachments", 36 | "is_array": True, 37 | "cls": TestRunAttachment, 38 | "arr_cls": ArrayOfTestRunAttachment, 39 | "inner_field_name": "TestRunAttachment", 40 | }, 41 | "comment": {"field_name": "comment", "cls": Text}, 42 | "defect_case_id": { 43 | "field_name": "defectURI", 44 | "cls": _WorkItem, 45 | "named_arg": "uri", 46 | "sync_field": "uri", 47 | }, 48 | "duration": "duration", 49 | "executed": "executed", 50 | "executed_by": { 51 | "field_name": "executedByURI", 52 | "cls": User, 53 | "named_arg": "uri", 54 | "sync_field": "uri", 55 | }, 56 | "result": {"field_name": "result", "cls": EnumOptionId, "enum_id": "result"}, 57 | "test_case_id": { 58 | "field_name": "testCaseURI", 59 | "cls": _WorkItem, 60 | "named_arg": "uri", 61 | "sync_field": "uri", 62 | }, 63 | "test_case_revision": "testCaseRevision", 64 | "test_step_results": { 65 | "field_name": "testStepResults", 66 | "is_array": True, 67 | "cls": TestStepResult, 68 | "arr_cls": ArrayOfTestStepResult, 69 | "inner_field_name": "TestStepResult", 70 | }, 71 | } 72 | _obj_client = "test_management_client" 73 | _obj_struct = "tns3:TestRecord" 74 | _id_field = "test_case_id" 75 | 76 | def __init__(self, project_id=None, test_case_id=None, suds_object=None): 77 | self.project_id = project_id if project_id else self.default_project 78 | super(self.__class__, self).__init__(test_case_id, suds_object) 79 | 80 | def _fix_circular_refs(self): 81 | # need to pass in the project_id parm to the Work Item, 82 | # but it is not given before instatiation 83 | self._cls_suds_map["test_case_id"]["additional_parms"] = { 84 | "project_id": self.project_id 85 | } 86 | self._cls_suds_map["defect_case_id"]["additional_parms"] = { 87 | "project_id": self.project_id 88 | } 89 | 90 | 91 | class ArrayOfTestRecord(BasePolarion): 92 | _obj_client = "test_management_client" 93 | _obj_struct = "tns3:ArrayOfTestRecord" 94 | -------------------------------------------------------------------------------- /src/pylero/test_run_attachment.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.user import User 9 | 10 | 11 | class TestRunAttachment(BasePolarion): 12 | """Object to handle the Polarion WSDL tns4:TestRunAttachment class 13 | 14 | Attributes: 15 | author (User) 16 | file_name (string) 17 | id (string) 18 | length (long) 19 | test_run_uri (SubterraURI) 20 | title (string) 21 | updated (dateTime) 22 | url (string)""" 23 | 24 | _cls_suds_map = { 25 | "author": {"field_name": "author", "cls": User}, 26 | "filename": "fileName", 27 | "id": "id", 28 | "length": "length", 29 | "title": "title", 30 | "updated": "updated", 31 | "url": "url", 32 | "test_run_uri": "testRunURI", 33 | "_uri": "_uri", 34 | "_unresolvable": "_unresolvable", 35 | } 36 | _obj_client = "test_management_client" 37 | _obj_struct = "tns4:TestRunAttachment" 38 | 39 | 40 | class ArrayOfTestRunAttachment(BasePolarion): 41 | _obj_client = "test_management_client" 42 | _obj_struct = "tns4:ArrayOfTestRunAttachment" 43 | -------------------------------------------------------------------------------- /src/pylero/test_step.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.text import ArrayOfText 9 | from pylero.text import Text 10 | 11 | 12 | class TestStep(BasePolarion): 13 | """Object to handle the Polarion WSDL tns3:TestStep class 14 | 15 | Attributes: 16 | values (ArrayOfText)""" 17 | 18 | _cls_suds_map = { 19 | "values": { 20 | "field_name": "values", 21 | "is_array": True, 22 | "cls": Text, 23 | "arr_cls": ArrayOfText, 24 | "inner_field_name": "Text", 25 | } 26 | } 27 | _obj_client = "test_management_client" 28 | _obj_struct = "tns3:TestStep" 29 | 30 | 31 | class ArrayOfTestStep(BasePolarion): 32 | _obj_client = "test_management_client" 33 | _obj_struct = "tns3:ArrayOfTestStep" 34 | -------------------------------------------------------------------------------- /src/pylero/test_step_result.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | from pylero.test_run_attachment import ArrayOfTestRunAttachment 10 | from pylero.test_run_attachment import TestRunAttachment 11 | from pylero.text import Text 12 | 13 | 14 | class TestStepResult(BasePolarion): 15 | """Object to handle the Polarion WSDL tns3:TestStepResult class 16 | 17 | Attributes: 18 | attachments (ArrayOfTestRunAttachment) 19 | comment (Text) 20 | result (EnumOptionId)""" 21 | 22 | _cls_suds_map = { 23 | "attachments": { 24 | "field_name": "attachments", 25 | "is_array": True, 26 | "cls": TestRunAttachment, 27 | "arr_cls": ArrayOfTestRunAttachment, 28 | "inner_field_name": "TestRunAttachment", 29 | }, 30 | "comment": {"field_name": "comment", "cls": Text}, 31 | "result": { 32 | "field_name": "result", 33 | "cls": EnumOptionId, 34 | "enum_id": "testing/test-result", 35 | }, 36 | "uri": "_uri", 37 | "_unresolved": "_unresolved", 38 | } 39 | _obj_client = "test_management_client" 40 | _obj_struct = "tns3:TestStepResult" 41 | 42 | 43 | class ArrayOfTestStepResult(BasePolarion): 44 | _obj_client = "test_management_client" 45 | _obj_struct = "tns3:ArrayOfTestStepResult" 46 | -------------------------------------------------------------------------------- /src/pylero/test_steps.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import ArrayOfEnumOptionId 9 | from pylero.enum_option_id import EnumOptionId 10 | from pylero.test_step import ArrayOfTestStep 11 | from pylero.test_step import TestStep 12 | 13 | 14 | class TestSteps(BasePolarion): 15 | """Object to handle the Polarion WSDL tns3:TestSteps class 16 | 17 | Attributes: 18 | keys (ArrayOfEnumOptionId) 19 | steps (ArrayOfTestStep)""" 20 | 21 | _cls_suds_map = { 22 | "keys": { 23 | "field_name": "keys", 24 | "is_array": True, 25 | "cls": EnumOptionId, 26 | "arr_cls": ArrayOfEnumOptionId, 27 | "inner_field_name": "EnumOptionId", 28 | "enum_id": "testing/test-step-keys", 29 | }, 30 | "steps": { 31 | "field_name": "steps", 32 | "is_array": True, 33 | "cls": TestStep, 34 | "arr_cls": ArrayOfTestStep, 35 | "inner_field_name": "TestStep", 36 | }, 37 | "uri": "_uri", 38 | "_unresolved": "_unresolved", 39 | } 40 | _obj_client = "test_management_client" 41 | _obj_struct = "tns3:TestSteps" 42 | -------------------------------------------------------------------------------- /src/pylero/tests_configuration.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.properties import Properties 9 | 10 | 11 | class TestsConfiguration(BasePolarion): 12 | """Object to handle the Polarion WSDL tns3:TestsConfiguration class 13 | 14 | Attributes: 15 | defect_auto_assignement_enabled (boolean) 16 | defect_reuse_type (string) 17 | defect_template (string) 18 | defect_to_test_case_link_role_id (string) 19 | defect_work_item_type (string) 20 | defects_project (string) 21 | fields_to_copy_from_test_case_to_defect (Properties) 22 | fields_to_copy_from_test_run_to_linked_defect (Properties) 23 | fields_to_copy_from_test_run_to_new_defect (Properties) 24 | max_created_defects (int) 25 | max_created_defects_percent (int) 26 | result_error_enum_id (string) 27 | result_failed_enum_id (string) 28 | result_passed_enum_id (string) 29 | retest_allowed (boolean) 30 | status_error_enum_id (string) 31 | status_failed_enum_id (string) 32 | status_ok_enum_id (string) 33 | summary_defect_severity (string) 34 | test_case_id_custom_field (string) 35 | test_case_template (string) 36 | test_case_test_comment_field_id (string) 37 | test_case_test_result_field_id (string) 38 | test_case_work_item_type (string) 39 | test_run_template (string)""" 40 | 41 | _cls_suds_map = { 42 | "defect_auto_assignement_enabled": "defectAutoAssignementEnabled", 43 | "defect_reuse_type": "defectReuseType", 44 | "defect_template": "defectTemplate", 45 | "defect_to_test_case_link_role_id": "defectToTestCaseLinkRoleId", 46 | "defect_work_item_type": "defectWorkItemType", 47 | "defects_project": "defectsProject", 48 | "fields_to_copy_from_test_case_to_defect": { 49 | "field_name": "fieldsToCopyFromTestCaseToDefect", 50 | "cls": Properties, 51 | }, 52 | "fields_to_copy_from_test_run_to_linked_defect": { 53 | "field_name": "fieldsToCopyFromTestRunToLinkedDefect", 54 | "cls": Properties, 55 | }, 56 | "fields_to_copy_from_test_run_to_new_defect": { 57 | "field_name": "fieldsToCopyFromTestRunToNewDefect", 58 | "cls": Properties, 59 | }, 60 | "max_created_defects": "maxCreatedDefects", 61 | "max_created_defects_percent": "maxCreatedDefectsPercent", 62 | "result_error_enum_id": "resultErrorEnumId", 63 | "result_failed_enum_id": "resultFailedEnumId", 64 | "result_passed_enum_id": "resultPassedEnumId", 65 | "retest_allowed": "retestAllowed", 66 | "status_error_enum_id": "statusErrorEnumId", 67 | "status_failed_enum_id": "statusFailedEnumId", 68 | "status_ok_enum_id": "statusOkEnumId", 69 | "summary_defect_severity": "summaryDefectSeverity", 70 | "test_case_id_custom_field": "testCaseIdCustomField", 71 | "test_case_template": "testCaseTemplate", 72 | "test_case_test_comment_field_id": "testCaseTestCommentFieldId", 73 | "test_case_test_result_field_id": "testCaseTestResultFieldId", 74 | "test_case_work_item_type": "testCaseWorkItemType", 75 | "test_run_template": "testRunTemplate", 76 | "uri": "_uri", 77 | "_unresolved": "_unresolved", 78 | } 79 | _obj_client = "test_management_client" 80 | _obj_struct = "tns3:TestsConfiguration" 81 | -------------------------------------------------------------------------------- /src/pylero/text.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | 9 | 10 | class Text(BasePolarion): 11 | """Object to manage Polarion TestManagement WS tns2:Text 12 | 13 | Rich text object 14 | 15 | Attributes: 16 | content (str): the formatted text 17 | content_type (str): indication of how content is formatted 18 | (eg. text/html) 19 | content_lossy (bool): 20 | """ 21 | 22 | _cls_suds_map = { 23 | "content": "content", 24 | "content_type": "type", 25 | "content_lossy": "contentLossy", 26 | } 27 | _id_field = "content" 28 | _obj_client = "test_management_client" 29 | _obj_struct = "tns2:Text" 30 | 31 | def __init__(self, content=None, suds_object=None): 32 | super(self.__class__, self).__init__(content, suds_object) 33 | 34 | def _get_suds_object(self): 35 | super(self.__class__, self)._get_suds_object() 36 | # default values 37 | self._suds_object.type = "text/html" 38 | self._suds_object.contentLossy = False 39 | 40 | 41 | class ArrayOfText(BasePolarion): 42 | """Object containing list of Text objects""" 43 | 44 | _obj_client = "test_management_client" 45 | _obj_struct = "tns2:ArrayOfText" 46 | -------------------------------------------------------------------------------- /src/pylero/time_point.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.text import Text 9 | 10 | 11 | class TimePoint(BasePolarion): 12 | """Object to handle the Polarion WSDL tns5:TimePoint class 13 | 14 | Attributes: 15 | closed (boolean) 16 | description (Text) 17 | earliest_planned_start (date) 18 | time_point_id (string) 19 | name (string) 20 | time (date)""" 21 | 22 | _cls_suds_map = { 23 | "closed": "closed", 24 | "description": {"field_name": "description", "cls": Text}, 25 | "earliest_planned_start": "earliestPlannedStart", 26 | "time_point_id": "id", 27 | "name": "name", 28 | "time": "time", 29 | "uri": "_uri", 30 | "_unresolved": "_unresolved", 31 | } 32 | _obj_client = "builder_client" 33 | _obj_struct = "tns5:TimePoint" 34 | -------------------------------------------------------------------------------- /src/pylero/wiki_page_attachment.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.user import User 9 | 10 | 11 | class WikiPageAttachment(BasePolarion): 12 | """Object to handle the Polarion WSDL tns3:WikiPageAttachment class 13 | 14 | Attributes: 15 | author (User) 16 | file_name (string) 17 | wiki_page_attachment_id (string) 18 | length (long) 19 | title (string) 20 | updated (dateTime) 21 | url (string)""" 22 | 23 | _cls_suds_map = { 24 | "author": {"field_name": "author", "cls": User}, 25 | "file_name": "fileName", 26 | "wiki_page_attachment_id": "id", 27 | "length": "length", 28 | "title": "title", 29 | "updated": "updated", 30 | "url": "url", 31 | "uri": "_uri", 32 | "_unresolved": "_unresolved", 33 | } 34 | _obj_client = "tracker_client" 35 | _obj_struct = "tns3:WikiPageAttachment" 36 | 37 | 38 | class ArrayOfWikiPageAttachment(BasePolarion): 39 | _obj_client = "tracker_client" 40 | _obj_struct = "tns3:ArrayOfWikiPageAttachment" 41 | -------------------------------------------------------------------------------- /src/pylero/work_record.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | from pylero.user import User 10 | 11 | 12 | class WorkRecord(BasePolarion): 13 | """Object to handle the Polarion WSDL tns5:WorkRecord class 14 | 15 | Attributes: 16 | comment (string) 17 | date (date) 18 | work_record_id (string) 19 | time_spent (duration) 20 | type (EnumOptionId) 21 | user (User)""" 22 | 23 | _cls_suds_map = { 24 | "comment": "comment", 25 | "date": "date", 26 | "work_record_id": "id", 27 | "time_spent": "timeSpent", 28 | "type": { 29 | "field_name": "type", 30 | "cls": EnumOptionId, 31 | "enum_id": "work-record-type", 32 | }, 33 | "user": {"field_name": "user", "cls": User}, 34 | "uri": "_uri", 35 | "_unresolved": "_unresolved", 36 | } 37 | _obj_client = "builder_client" 38 | _obj_struct = "tns5:WorkRecord" 39 | 40 | 41 | class ArrayOfWorkRecord(BasePolarion): 42 | _obj_client = "builder_client" 43 | _obj_struct = "tns5:ArrayOfWorkRecord" 44 | -------------------------------------------------------------------------------- /src/pylero/workflow_action.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | from pylero.base_polarion import BasePolarion 8 | from pylero.enum_option_id import EnumOptionId 9 | 10 | 11 | class WorkflowAction(BasePolarion): 12 | """Object to handle the Polarion WSDL tns3:WorkflowAction class 13 | 14 | Attributes: 15 | action_id (int) 16 | action_name (string) 17 | cleaned_features (ArrayOf_xsd_string) 18 | native_action_id (string) 19 | required_features (ArrayOf_xsd_string) 20 | suggested_features (ArrayOf_xsd_string) 21 | target_status (EnumOptionId) 22 | unavailability_message (string)""" 23 | 24 | _cls_suds_map = { 25 | "action_id": "actionId", 26 | "action_name": "actionName", 27 | "cleaned_features": "cleaned_features", 28 | "native_action_id": "nativeActionId", 29 | "required_features": "requiredFeatures", 30 | "suggested_features": "suggestedFeatures", 31 | "target_status": {"field_name": "targetStatus", "cls": EnumOptionId}, 32 | "unavailability_message": "unavailabilityMessage", 33 | "uri": "_uri", 34 | "_unresolved": "_unresolved", 35 | } 36 | _obj_client = "tracker_client" 37 | _obj_struct = "tns3:WorkflowAction" 38 | -------------------------------------------------------------------------------- /src/unit_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatQE/pylero/711b367d91116e6957ff69690684337a0ffc5813/src/unit_tests/__init__.py -------------------------------------------------------------------------------- /src/unit_tests/document_test.py: -------------------------------------------------------------------------------- 1 | """ 2 | Created on Apr 13, 2015 3 | 4 | @author: szacks 5 | """ 6 | import datetime 7 | import os 8 | import unittest 9 | 10 | from pylero.document import Document 11 | from pylero.test_run import TestRun 12 | from pylero.work_item import TestCase 13 | 14 | WI_ID = "" 15 | TIME_STAMP = datetime.datetime.now().strftime("%Y%m%d%H%M%s") 16 | DOC_NAME = "Document_Test-%s" % TIME_STAMP 17 | # TEMPLATE_ID and TEST_RUN_ID will be changed if the project Generate ID is set 18 | TEMPLATE_ID = "doc_tmp_test-%s" % TIME_STAMP 19 | TEST_RUN_ID = "doc_test-%s" % TIME_STAMP 20 | TEMPLATE_TITLE = "doc_tmp_test-%s" % TIME_STAMP 21 | TEST_RUN_TITLE = "doc_test-%s" % TIME_STAMP 22 | 23 | 24 | class DocumentTest(unittest.TestCase): 25 | @classmethod 26 | def setUpClass(cls): 27 | cls.doc_create = Document.create( 28 | Document.default_project, 29 | "Testing", 30 | DOC_NAME, 31 | "Document_Test", 32 | ["testcase"], 33 | "testspecification", 34 | ) 35 | 36 | def test_002_get_documents(self): 37 | lst_doc = Document.get_documents(Document.default_project, "Testing") 38 | doc = lst_doc[0] 39 | self.assertIsInstance(doc, Document) 40 | 41 | def test_003_query(self): 42 | lst_doc = Document.query("project.id:" + Document.default_project, limit=10) 43 | doc = lst_doc[0] 44 | self.assertIsInstance(doc, Document) 45 | 46 | def test_004_get_name(self): 47 | self.doc_get1 = Document( 48 | project_id=Document.default_project, doc_with_space="Testing/" + DOC_NAME 49 | ) 50 | self.assertIsInstance(self.doc_get1, Document) 51 | 52 | def test_005_get_uri(self): 53 | self.doc_get2 = Document(uri=self.doc_create.uri) 54 | self.assertIsInstance(self.doc_get2, Document) 55 | 56 | def test_006_create_work_item(self): 57 | tc = TestCase() 58 | tc.title = "regression" 59 | tc.description = "regression document test" 60 | tc.status = "draft" 61 | tc.caseimportance = "high" 62 | tc.caselevel = "component" 63 | tc.caseautomation = "notautomated" 64 | tc.caseposneg = "positive" 65 | tc.testtype = "functional" 66 | tc.subtype1 = "-" 67 | doc = Document(uri=self.doc_create.uri) 68 | wi = doc.create_work_item(None, tc) 69 | doc_wis = doc.get_work_items(None, True) 70 | doc_wi_ids = [doc_wi.work_item_id for doc_wi in doc_wis] 71 | self.assertIn(wi.work_item_id, doc_wi_ids) 72 | global WI_ID 73 | WI_ID = wi.work_item_id 74 | 75 | def test_007_update(self): 76 | doc = Document(uri=self.doc_create.uri) 77 | doc.status = "published" 78 | doc.update() 79 | 80 | def test_008_doc_test_run_template(self): 81 | global TEMPLATE_ID 82 | global TEST_RUN_ID 83 | doc_with_space = self.doc_create.space 84 | self.doc_create.session.tx_begin() 85 | tmp = TestRun.create_template( 86 | project_id=Document.default_project, 87 | template_id=TEMPLATE_ID, 88 | doc_with_space=doc_with_space, 89 | title=TEMPLATE_TITLE, 90 | ) 91 | TEMPLATE_ID = tmp.test_run_id 92 | tr = TestRun.create( 93 | project_id=Document.default_project, 94 | test_run_id=TEST_RUN_ID, 95 | template=TEMPLATE_ID, 96 | title=TEST_RUN_TITLE, 97 | ) 98 | TEST_RUN_ID = tr.test_run_id 99 | self.assertEqual(len(tr.records), 1) 100 | self.assertEqual(tr.records[0].test_case_id, WI_ID) 101 | self.doc_create.session.tx_commit() 102 | 103 | def test_009_export_pdf(self): 104 | uri = self.doc_create.uri 105 | exportPdfProperties = { 106 | "paperSize": "A4", 107 | "orientation": "portrait", 108 | "fitToPageWidth": True, 109 | "includeHeaderFooter": True, 110 | } 111 | output_dir = os.getcwd() 112 | Document.export_pdf(uri, exportPdfProperties, output_dir, "test009_export_pdf") 113 | assert os.path.isfile(f"{output_dir}/test009_export_pdf.pdf") 114 | 115 | 116 | if __name__ == "__main__": 117 | # import sys;sys.argv = ['', 'Test.testName'] 118 | unittest.main() 119 | -------------------------------------------------------------------------------- /src/unit_tests/plan_test.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import os 3 | import unittest 4 | 5 | from pylero.exceptions import PyleroLibException 6 | from pylero.plan import Plan 7 | from pylero.work_item import Requirement 8 | 9 | TIME_STAMP = datetime.datetime.now().strftime("%Y%m%d%H%M%s") 10 | DEFAULT_PROJ = Plan.default_project 11 | TEMPLATE_ID = "tmp_reg-%s" % TIME_STAMP 12 | PLAN_ID = "plan_reg-%s" % TIME_STAMP 13 | 14 | CUR_PATH = os.path.dirname(os.path.abspath(__file__)) 15 | ATTACH_PATH = CUR_PATH + "/refs/red_box.png" 16 | ATTACH_TITLE = "File" 17 | 18 | 19 | class PlanTest(unittest.TestCase): 20 | @classmethod 21 | def setUpClass(cls): 22 | req1 = Requirement.create( 23 | DEFAULT_PROJ, 24 | "regression", 25 | "regression", 26 | severity="should_have", 27 | reqtype="functional", 28 | ) 29 | 30 | cls.NEW_REQ = req1.work_item_id 31 | req2 = Requirement.create( 32 | DEFAULT_PROJ, 33 | "regression", 34 | "regression", 35 | severity="should_have", 36 | reqtype="functional", 37 | ) 38 | cls.NEW_REQ2 = req2.work_item_id 39 | 40 | def test_001_create_template(self): 41 | """This test does the following: 42 | * Creates a Plan template with no parent 43 | * Verifies that the returned object exists and is a template 44 | The parent attribute is not returned 45 | """ 46 | template = Plan.create_plan_template( 47 | TEMPLATE_ID, "Regression", DEFAULT_PROJ, None 48 | ) 49 | self.assertIsNotNone(template.plan_id) 50 | self.assertTrue(template.is_template) 51 | 52 | def test_002_create_plan(self): 53 | """This test does the following: 54 | * creates a test riun based on the template created in previous test 55 | * Verifies that the returned object exists and is not a template 56 | """ 57 | plan = Plan.create(PLAN_ID, "Regression", DEFAULT_PROJ, None, TEMPLATE_ID) 58 | self.assertIsNotNone(plan.plan_id) 59 | self.assertFalse(plan.is_template) 60 | 61 | def test_003_search_template(self): 62 | lst_res = Plan.search("id:%s" % TEMPLATE_ID, search_templates=True) 63 | self.assertEqual(len(lst_res), 1) 64 | self.assertEqual(lst_res[0].plan_id, TEMPLATE_ID) 65 | 66 | def test_004_search_plan(self): 67 | lst_res = Plan.search("id:%s" % PLAN_ID) 68 | self.assertEqual(len(lst_res), 1) 69 | self.assertEqual(lst_res[0].plan_id, PLAN_ID) 70 | 71 | def test_005_get_plan(self): 72 | plan = Plan(project_id=DEFAULT_PROJ, plan_id=PLAN_ID) 73 | self.assertEqual(plan.plan_id, PLAN_ID) 74 | plan2 = Plan(uri=plan.uri) 75 | self.assertEqual(plan2.plan_id, PLAN_ID) 76 | 77 | def test_006_add_items(self): 78 | plan = Plan(project_id=DEFAULT_PROJ, plan_id=PLAN_ID) 79 | plan.add_plan_items([self.NEW_REQ, self.NEW_REQ2]) 80 | plan.reload() 81 | self.assertEqual(len(plan.records), 2) 82 | 83 | def test_007_stats(self): 84 | plan = Plan(project_id=DEFAULT_PROJ, plan_id=PLAN_ID) 85 | stats = plan.get_statistics() 86 | self.assertEqual(stats.number_of_planned, 2) 87 | 88 | def test_008_remove_wi(self): 89 | plan = Plan(project_id=DEFAULT_PROJ, plan_id=PLAN_ID) 90 | plan.remove_plan_items([self.NEW_REQ]) 91 | plan.reload() 92 | self.assertEqual(len(plan.records), 1) 93 | self.assertEqual(plan.records[0].item, self.NEW_REQ2) 94 | 95 | def test_009_update(self): 96 | plan = Plan(project_id=DEFAULT_PROJ, plan_id=PLAN_ID) 97 | plan.color = "red" 98 | plan.update() 99 | plan.color = "" 100 | plan.reload() 101 | self.assertEqual(plan.color, "red") 102 | 103 | def test_010_delete(self): 104 | Plan.delete_plans(DEFAULT_PROJ, PLAN_ID) 105 | with self.assertRaises(PyleroLibException): 106 | Plan(project_id=DEFAULT_PROJ, plan_id=PLAN_ID) 107 | 108 | 109 | if __name__ == "__main__": 110 | # import sys;sys.argv = ['', 'Test.testName'] 111 | unittest.main() 112 | -------------------------------------------------------------------------------- /src/unit_tests/refs/red_box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatQE/pylero/711b367d91116e6957ff69690684337a0ffc5813/src/unit_tests/refs/red_box.png -------------------------------------------------------------------------------- /src/unit_tests/revert_tests.py: -------------------------------------------------------------------------------- 1 | import pysvn 2 | from pylero.project import Project 3 | from pylero.test_run import TestRun 4 | 5 | REVERT_TO = 2590 6 | # this is the svn revision that the project should be reverted to for a clean 7 | # environment. If anything required by the tests is added to the project, it 8 | # must be manually cleaned and this number must be updated. 9 | 10 | 11 | def revert_svn(): 12 | proj = Project(Project.default_project) 13 | proj_grp = proj.project_group.name 14 | svn_url = "%s/%s/%s" % (proj.repo, proj_grp, proj.project_id) 15 | LOCAL_DIR = "/tmp/%s" % proj.project_id 16 | USER = proj.logged_in_user_id 17 | PASS = proj.session.password 18 | svn = pysvn.Client() 19 | svn.set_default_username(USER) 20 | svn.set_default_password(PASS) 21 | svn.set_store_passwords(False) 22 | svn.checkout(svn_url, LOCAL_DIR) 23 | svn_log = svn.log(LOCAL_DIR) 24 | # first_revision = svn_log[-1].revision 25 | for log in svn_log: 26 | if log.revision.number == REVERT_TO: 27 | break 28 | first_revision = log.revision 29 | last_revision = svn_log[0].revision 30 | svn.merge(LOCAL_DIR, last_revision, LOCAL_DIR, first_revision, LOCAL_DIR) 31 | svn.checkin(LOCAL_DIR, "revert to original version") 32 | # The original Example template query has an extra colon. 33 | # After revert, must fix that. 34 | tmpl = TestRun(project_id=proj.project_id, test_run_id="Example") 35 | tmpl.query = tmpl.query.replace("::", ":") 36 | tmpl.update() 37 | 38 | 39 | if __name__ == "__main__": 40 | revert_svn() 41 | -------------------------------------------------------------------------------- /tier_tests.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | import subprocess 4 | import sys 5 | 6 | # this script execute tier testsing for pylero 7 | # if the first argument is "tier0" it tests tier0 8 | # if the first argument is "tier1" it tests tier1 9 | # if the first argument is 'all' it tests tier0+tier1 10 | 11 | 12 | def get_command(x): 13 | return { 14 | "tier0": "attribute_test", 15 | "tier1": "test_run_test document_test work_item_test plan_test", 16 | "all": "attribute_test test_run_test document_test" " work_item_test plan_test", 17 | }.get(x) 18 | 19 | 20 | if __name__ == "__main__": 21 | nose = "nose2 --plugin nose2.plugins.junitxml --junit-xml" 22 | coverage = " --with-coverage --coverage-report xml" 23 | src = " -s src/unit_tests " 24 | tests = None 25 | 26 | if len(sys.argv) == 2: 27 | tests = get_command(sys.argv[1]) 28 | 29 | if tests: 30 | command = nose + coverage + src + tests 31 | print("Execute " + tests + ":") 32 | sys.exit(subprocess.call(command.split())) 33 | else: 34 | print("Usage: tiertests.py [args]") 35 | print("args: 'tier0' or 'tier1' or 'all'") 36 | sys.exit(1) 37 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | # Tox (http://tox.testrun.org/) is a tool for running tests 2 | # in multiple virtualenvs. This configuration file will run the 3 | # test suite on all supported python versions. To use it, "pip install tox" 4 | # and then run "tox" from this directory. 5 | 6 | [tox] 7 | testenv=py{38,39,310,311,312} 8 | 9 | [base] 10 | deps = 11 | cov-core 12 | nose2[coverage-plugin] 13 | commands = 14 | python tier_tests.py {posargs} 15 | 16 | [testenv:py38] 17 | basepython = python3.8 18 | deps = 19 | suds 20 | {[base]deps} 21 | commands = {[base]commands} 22 | [testenv:py39] 23 | basepython = python3.9 24 | deps = 25 | suds 26 | {[base]deps} 27 | commands = {[base]commands} 28 | [testenv:py310] 29 | basepython = python3.10 30 | deps = 31 | suds 32 | {[base]deps} 33 | commands = {[base]commands} 34 | [testenv:py311] 35 | basepython = python3.11 36 | deps = 37 | suds 38 | {[base]deps} 39 | commands = {[base]commands} 40 | [testenv:py312] 41 | basepython = python3.12 42 | deps = 43 | suds 44 | {[base]deps} 45 | commands = {[base]commands} 46 | --------------------------------------------------------------------------------