Utility to share Robot Framework resource files in Python packages.
Project description
rf-shared-resources
Library for importing Robot Framework resource files from python libraries. See examples/ directory for an example of Python library with embedded Robot Framework resources and usage of this library.
Usage
There are three different ways to import resources with this library: inside the Python library that contains the resources, in Settings table with initialization parameters, or through a keyword.
Inside a Python library
from SharedResources import SharedResources
class EmbeddedResources(SharedResources):
def __init__(self):
super().__init__(
'EmbeddedResources.resources',
'a_keywords.resource',
'b_keywords.robot')
In settings table
*** Settings ***
Library SharedResources EmbeddedResources
... a_keywords.resource b_keywords.robot
Through a keyword
*** Settings ***
Library SharedResources
*** Keywords ***
Load resources
Import resource from package EmbeddedResources.resources
... a_keywords.resource b_keywords.robot
Testing
Check and automatically fix formatting with:
pycodestyle SharedResources
autopep8 -aaar --in-place SharedResources
Run static analysis with:
pylint -E --enable=invalid-name,unused-import,useless-object-inheritance SharedResources
Run acceptance tests:
# Run acceptance tests
robot -L TRACE:INFO -d out/ acceptance_tests/
# Run acceptance tests with coverage analysis
coverage run \
--branch \
--source SharedResources/ \
-m robot -L TRACE:INFO -d out/ acceptance_tests/
coverage report -m
Run acceptance tests in Docker container:
# Build image
docker build . -t atest
# Run acceptance tests
docker run --rm atest
# Run acceptance tests and get test output to ./out
docker run -v $(pwd)/out:/out --rm atest -d /out -L TRACE:INFO
Generate documentation with:
python3 -m robot.libdoc SharedResources docs/index.html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for rf-shared-resources-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b48e389acdd0cf70424875a3ec5388b1c1a895b38f7b91a4509d69d37370714 |
|
MD5 | 245ed7398e5607abfd1ecb3c4aa8ec74 |
|
BLAKE2b-256 | 937f846b9da13e93ab0b6bd1fa3d6b357fbe665a19518c10c605a3c592669023 |
Close
Hashes for rf_shared_resources-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d74a543e58ce3d3c7f9f5292a76c800fd5b9425406d153ef8e42d565823f6ff6 |
|
MD5 | 7ef1c84253709c7568fbd1b3137b724a |
|
BLAKE2b-256 | 4733ea2d11a290b93831fea90a6001d82c1e6cb4f1a059d858cd93c2f85b52eb |