NetSpyGlass SDK
Project description
nsg-python-sdk
This repository contains changes for nsg-python-sdk python package. This package will be uploaded to the PyPI so that customer can install package and test their changes.
nsg-python-sdk package
Install nsg-python-sdk from PyPI. This package exposes nsgsdk binary.
pip install nsg-python-sdk
currently nsgsdk supports running tags, variables and views app request. Supported apps can be found by running the following command.
# nsgsdk -h
Usage: nsgsdk [OPTIONS] COMMAND [ARGS]...
Options:
--version Show the version and exit.
-h, --help Show this message and exit.
Commands:
tags run tags application
test run tests in the current repository
variables run variable builder application
views run views application
How to run apps on local machine
Go to the directory which contains scripts for testing.
To run module tags
using embedded tags_app.py
, we could use the following steps
to check the required parameters and options we can use the help option
# nsgsdk tags -h
Usage: nsgsdk tags [OPTIONS] INPUT_DEVICE
NetSpyGlass tags assignment Python application
Options:
-f, --format [json|pb] use this format to generate output [default: json]
-o, --output TEXT the file name where the result should be stored; if
missing or equal to "-", use stdout
-h, --help Show this message and exit.
tags
command specifies that we want to run the tags app.
then to run it with input
nsgsdk tags <path_to_input_file> -o <path_to_output_file>
Run unit test cases.
- cd to the scripts directory.
- create directory
tests
and put your test modules there. If your tests need data files, we recommend placing them in the directorytests/fixtures
. Directory structure should look like this:
~/src/test-repo/scripts$ tree
├── __init__.py
├── rules.py
├── tags.py
├── tests
│ ├── __init__.py
│ ├── fixtures
│ │ └── ex2200-pb.json
│ └── test_tags.py
├── var_builder.py
└── views.py
to run the tests, change to the directory which contains scripts directory. We can use the following command
nsgsdk test
To check the required parameters and option we can use the following command:
nsgsdk test -h
Usage: nsgsdk test [OPTIONS] PATH
Options:
-h, --help Show this message and exit.
here Path can be module or directory path.
To run the tests in the directory, we can use the following command:
nsgsdk test scripts/tests
To run the tests in module, we can use the following command:
nsgsdk test scripts/tests/test_tags_1.py
Project details
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
File details
Details for the file nsg-python-sdk-0.0.4.tar.gz
.
File metadata
- Download URL: nsg-python-sdk-0.0.4.tar.gz
- Upload date:
- Size: 65.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6faefc49f19c930776c762a79b0ab78c9b9d09e65926f9c00bced6b7339a5f4f |
|
MD5 | 0171c796a73f30318b2dadbcf7c38dd1 |
|
BLAKE2b-256 | 981244b40b0f36ff07d42b22cd16fc0e1789fc6825c849fc9152af3751436e6e |
File details
Details for the file nsg_python_sdk-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: nsg_python_sdk-0.0.4-py3-none-any.whl
- Upload date:
- Size: 85.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d70c55e6a99670aca3aa627db6f76942cde1d3f4f1cc5f7292820ff27afe5f7 |
|
MD5 | 464c37b881584475109475d7c043d141 |
|
BLAKE2b-256 | b5e8f9b9d281ca9773312c7c9d3d751a102ee492df874726de0078ab3f0fe3db |