From 3cf287858d65b60855136f41596a03e610f8c358 Mon Sep 17 00:00:00 2001 From: Aleksandr Shpak Date: Fri, 22 Nov 2024 20:53:41 +0300 Subject: [PATCH] feat: robot doc https://shpaker.github.io/winregistry/winregistry.robot --- .github/workflows/doc.yml | 23 + .github/workflows/pypi.yml | 2 + .github/workflows/{tests.yml => robot.yml} | 9 +- Justfile | 3 + README.md | 6 + winregistry.py | 5 + winregistry.robot.html | 1876 ++++++++++++++++++++ 7 files changed, 1919 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/doc.yml rename .github/workflows/{tests.yml => robot.yml} (83%) create mode 100644 winregistry.robot.html diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 0000000..4334347 --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,23 @@ +--- +on: + push: + branches: [ main ] + +jobs: + doc: + runs-on: windows-latest + steps: + - uses: extractions/setup-just@v2 + - uses: actions/setup-python@v5 + with: + python-version: 3.10 + - uses: actions/checkout@v4 + - run: | + python -m pip install poetry~=1.8.4 + poetry install --no-ansi --sync + - run: just doc + - uses: actions/upload-artifact@v4 + if: always() + with: + name: robot_doc + path: index.html diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 18c860f..ce4de62 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,4 +1,6 @@ --- +name: Build + on: release: types: [created] diff --git a/.github/workflows/tests.yml b/.github/workflows/robot.yml similarity index 83% rename from .github/workflows/tests.yml rename to .github/workflows/robot.yml index 0ac0f07..963789f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/robot.yml @@ -1,17 +1,16 @@ --- -name: Lint +name: Robot on: pull_request: branches: [ main ] jobs: - lint: + tests: runs-on: windows-latest strategy: matrix: PYTHON_VERSION: -# - "3.7" - "3.8" - "3.9" - "3.10" @@ -26,10 +25,10 @@ jobs: - uses: actions/checkout@v4 - run: | python -m pip install poetry~=1.8.4 - poetry install --no-ansi + poetry install --no-ansi --sync - run: just tests - uses: actions/upload-artifact@v4 if: always() with: - name: ${{ matrix.PYTHON_VERSION }}_robot_log + name: py${{ matrix.PYTHON_VERSION }}_robot_log path: log.html diff --git a/Justfile b/Justfile index 762b1fc..dd0d392 100644 --- a/Justfile +++ b/Justfile @@ -12,3 +12,6 @@ fix: tests: poetry run robot {{ TESTS_FILE }} + +doc: + poetry run libdoc winregistry.robot index.html diff --git a/README.md b/README.md index fc7fd50..d373ee6 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,12 @@ with open_key( ## Usage with [Robot Testing Framework](https://robotframework.org/) +### Documentation + +https://shpaker.github.io/winregistry/winregistry.robot + +### Example + ```robotframework *** Variables *** ${ SUITE_KEY_NAME } HKLM\\SOFTWARE\\_ROBOT_TESTS_ diff --git a/winregistry.py b/winregistry.py index 48fefef..f27c436 100644 --- a/winregistry.py +++ b/winregistry.py @@ -429,6 +429,11 @@ class robot: # noqa: N801 def registry_key_should_exist( key_name: str, ) -> None: + """ + specified key should exist + Args: + key_name: sub_key is a string that identifies the sub_key to open + """ with open_key( key_name, sub_key_ensure=False, diff --git a/winregistry.robot.html b/winregistry.robot.html new file mode 100644 index 0000000..6bacf68 --- /dev/null +++ b/winregistry.robot.html @@ -0,0 +1,1876 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening library documentation failed

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +