cdrouter


Namecdrouter JSON
Version 0.9.5 PyPI version JSON
download
home_pagehttps://github.com/qacafe/cdrouter.py
SummaryPython client for the CDRouter Web API
upload_time2023-08-04 16:06:12
maintainer
docs_urlNone
authorQA Cafe
requires_python
licenseMIT
keywords cdrouter json rest api client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            cdrouter
========

.. image:: https://img.shields.io/pypi/v/cdrouter.svg
    :target: https://pypi.python.org/pypi/cdrouter

Simple Python wrapper for the CDRouter Web
API. https://support.qacafe.com/cdrouter/cdrouter-web-api/

For more information on CDRouter, please visit http://www.qacafe.com/.

Installing/Upgrading
====================

cdrouter is available on PyPI.  To install the latest stable version from PyPI:

.. code-block:: bash

    $ pip install -U cdrouter

cdrouter supports Python 3.5 or newer.

Documentation
=============

See http://cdrouterpy.readthedocs.io/.

Unit Tests
==========

Unit tests for cdrouter.py are written using pytest
(https://docs.pytest.org) and run with tox (https://tox.wiki).  Each
test starts up an ephemeral CDRouter Docker container to test against.
Tests are stored in the ``tests/`` directory.  The following tooling
is required to run the unit tests:

- Docker must be installed and the ``docker`` command runnable by the
  current user.  Follow the official install instructions
  (https://docs.docker.com/engine/install/) to ensure this is the
  case.

- Python 3.8 must be installed with a ``python3.8`` binary available
  in your ``PATH``.

- ``tox`` must be installed via ``pip3``:

  .. code-block:: bash

      $ pip3 install -U tox

  If you do not already have ``pip3`` installed, follow the official
  install instructions (https://pip.pypa.io/en/stable/installation/)
  or use the ``get-pip.py`` script below to perform the installation
  automatically:

  .. code-block:: bash

      $ curl -s https://bootstrap.pypa.io/pip/get-pip.py | python3

The unit tests are controlled by a number of a environment variables,
some required while others are optional.  Optional environment
variables are listed further below.  The required environment
variables are:

- ``CDR_DOCKER_IMAGE``: The CDRouter Docker image to use to test
  against.  The unit tests automatically create and teardown Docker
  containers running this image during testing.  Its value should be a
  Docker image name that can be passed directly to ``docker run``.  A
  good default is:

  .. code-block:: bash

      CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latest

  which should always be the latest CDRouter release.

- ``CDR_DOCKER_LICENSE``: The base64-encoded contents of a CDRouter
  license file with all addons enabled to be used in the CDRouter
  Docker containers which are created during testing.  If the CDRouter
  license file to be used exists at ``/path/to/cdrouter.lic``, set
  this variable to:

  .. code-block:: bash

      CDR_DOCKER_LICENSE=$(base64 -w0 /path/to/cdrouter.lic)

Finally, run the unit tests via:

.. code-block:: bash

    $ CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latest \
      CDR_DOCKER_LICENSE=$(base64 -w0 /path/to/cdrouter.lic) \
      tox -p

This will both lint the codebase using ``pylint`` and run all unit
tests.  You may sometimes want to run only a subset of tests.  To run
just the tests in ``tests/test_configs.py``, run:

.. code-block:: bash

    $ CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latest \
      CDR_DOCKER_LICENSE=$(base64 -w0 /path/to/cdrouter.lic) \
      tox -e py38 -- tests/test_configs.py

To run just the ``test_list`` test in the ``TestConfigs`` class of
``tests/test_configs.py``, run:

.. code-block:: bash

    $ CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latest \
      CDR_DOCKER_LICENSE=$(base64 -w0 /path/to/cdrouter.lic) \
      tox -e py38 -- tests/test_configs.py::TestConfigs::test_list

Below are the optional environment variables used by the unit tests:

- ``CDR_DOCKER_PULL``: By default, the unit tests will ensure the
  Docker image specified by ``CDR_DOCKER_IMAGE`` is present and up to
  date via a call to ``docker pull``.  Sometimes this isn't necessary
  or desired, in which case setting ``CDR_DOCKER_PULL=0`` will cause
  the unit tests to skip this step and assume the Docker image is
  already present and up to date.  Setting ``CDR_DOCKER_PULL=0`` is
  often necessary if ``CDR_DOCKER_IMAGE`` is set to a locally-built
  image rather than one pulled down from a Docker registry.

- ``CLOUDSHARK_URL`` & ``CLOUDSHARK_TOKEN``: These variables specify
  the URL and valid API token of a CloudShark appliance.  If these are
  not set, tests which require uploading capture files to a CloudShark
  appliance are skipped.

- ``RUN_LOUNGE_TESTS``, ``LOUNGE_EMAIL``, ``LOUNGE_URL`` &
  ``LOUNGE_INSECURE``: By default, tests which require communicating
  with the QA Cafe Lounge are skipped.  These tests can be run by
  setting ``RUN_LOUNGE_TESTS=1``, in which case ``LOUNGE_EMAIL`` must
  be set to a valid email address for a contact in same Lounge account
  as the CDRouter license stored in ``CDR_DOCKER_LICENSE``.
  Additionally, ``LOUNGE_URL`` and ``LOUNGE_INSECURE`` can be used to
  have the tests talk to a non-production Lounge.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/qacafe/cdrouter.py",
    "name": "cdrouter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "cdrouter json rest api client",
    "author": "QA Cafe",
    "author_email": "support@qacafe.com",
    "download_url": "https://files.pythonhosted.org/packages/8e/81/67c6f6033ce6df4bcc54a62a99e920f1479f779ae06db05b11630ace5fd6/cdrouter-0.9.5.tar.gz",
    "platform": null,
    "description": "cdrouter\n========\n\n.. image:: https://img.shields.io/pypi/v/cdrouter.svg\n    :target: https://pypi.python.org/pypi/cdrouter\n\nSimple Python wrapper for the CDRouter Web\nAPI. https://support.qacafe.com/cdrouter/cdrouter-web-api/\n\nFor more information on CDRouter, please visit http://www.qacafe.com/.\n\nInstalling/Upgrading\n====================\n\ncdrouter is available on PyPI.  To install the latest stable version from PyPI:\n\n.. code-block:: bash\n\n    $ pip install -U cdrouter\n\ncdrouter supports Python 3.5 or newer.\n\nDocumentation\n=============\n\nSee http://cdrouterpy.readthedocs.io/.\n\nUnit Tests\n==========\n\nUnit tests for cdrouter.py are written using pytest\n(https://docs.pytest.org) and run with tox (https://tox.wiki).  Each\ntest starts up an ephemeral CDRouter Docker container to test against.\nTests are stored in the ``tests/`` directory.  The following tooling\nis required to run the unit tests:\n\n- Docker must be installed and the ``docker`` command runnable by the\n  current user.  Follow the official install instructions\n  (https://docs.docker.com/engine/install/) to ensure this is the\n  case.\n\n- Python 3.8 must be installed with a ``python3.8`` binary available\n  in your ``PATH``.\n\n- ``tox`` must be installed via ``pip3``:\n\n  .. code-block:: bash\n\n      $ pip3 install -U tox\n\n  If you do not already have ``pip3`` installed, follow the official\n  install instructions (https://pip.pypa.io/en/stable/installation/)\n  or use the ``get-pip.py`` script below to perform the installation\n  automatically:\n\n  .. code-block:: bash\n\n      $ curl -s https://bootstrap.pypa.io/pip/get-pip.py | python3\n\nThe unit tests are controlled by a number of a environment variables,\nsome required while others are optional.  Optional environment\nvariables are listed further below.  The required environment\nvariables are:\n\n- ``CDR_DOCKER_IMAGE``: The CDRouter Docker image to use to test\n  against.  The unit tests automatically create and teardown Docker\n  containers running this image during testing.  Its value should be a\n  Docker image name that can be passed directly to ``docker run``.  A\n  good default is:\n\n  .. code-block:: bash\n\n      CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latest\n\n  which should always be the latest CDRouter release.\n\n- ``CDR_DOCKER_LICENSE``: The base64-encoded contents of a CDRouter\n  license file with all addons enabled to be used in the CDRouter\n  Docker containers which are created during testing.  If the CDRouter\n  license file to be used exists at ``/path/to/cdrouter.lic``, set\n  this variable to:\n\n  .. code-block:: bash\n\n      CDR_DOCKER_LICENSE=$(base64 -w0 /path/to/cdrouter.lic)\n\nFinally, run the unit tests via:\n\n.. code-block:: bash\n\n    $ CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latest \\\n      CDR_DOCKER_LICENSE=$(base64 -w0 /path/to/cdrouter.lic) \\\n      tox -p\n\nThis will both lint the codebase using ``pylint`` and run all unit\ntests.  You may sometimes want to run only a subset of tests.  To run\njust the tests in ``tests/test_configs.py``, run:\n\n.. code-block:: bash\n\n    $ CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latest \\\n      CDR_DOCKER_LICENSE=$(base64 -w0 /path/to/cdrouter.lic) \\\n      tox -e py38 -- tests/test_configs.py\n\nTo run just the ``test_list`` test in the ``TestConfigs`` class of\n``tests/test_configs.py``, run:\n\n.. code-block:: bash\n\n    $ CDR_DOCKER_IMAGE=registry.gitlab.com/qacafe/cdrouter/cdrouter/cdrouter:latest \\\n      CDR_DOCKER_LICENSE=$(base64 -w0 /path/to/cdrouter.lic) \\\n      tox -e py38 -- tests/test_configs.py::TestConfigs::test_list\n\nBelow are the optional environment variables used by the unit tests:\n\n- ``CDR_DOCKER_PULL``: By default, the unit tests will ensure the\n  Docker image specified by ``CDR_DOCKER_IMAGE`` is present and up to\n  date via a call to ``docker pull``.  Sometimes this isn't necessary\n  or desired, in which case setting ``CDR_DOCKER_PULL=0`` will cause\n  the unit tests to skip this step and assume the Docker image is\n  already present and up to date.  Setting ``CDR_DOCKER_PULL=0`` is\n  often necessary if ``CDR_DOCKER_IMAGE`` is set to a locally-built\n  image rather than one pulled down from a Docker registry.\n\n- ``CLOUDSHARK_URL`` & ``CLOUDSHARK_TOKEN``: These variables specify\n  the URL and valid API token of a CloudShark appliance.  If these are\n  not set, tests which require uploading capture files to a CloudShark\n  appliance are skipped.\n\n- ``RUN_LOUNGE_TESTS``, ``LOUNGE_EMAIL``, ``LOUNGE_URL`` &\n  ``LOUNGE_INSECURE``: By default, tests which require communicating\n  with the QA Cafe Lounge are skipped.  These tests can be run by\n  setting ``RUN_LOUNGE_TESTS=1``, in which case ``LOUNGE_EMAIL`` must\n  be set to a valid email address for a contact in same Lounge account\n  as the CDRouter license stored in ``CDR_DOCKER_LICENSE``.\n  Additionally, ``LOUNGE_URL`` and ``LOUNGE_INSECURE`` can be used to\n  have the tests talk to a non-production Lounge.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python client for the CDRouter Web API",
    "version": "0.9.5",
    "project_urls": {
        "Homepage": "https://github.com/qacafe/cdrouter.py"
    },
    "split_keywords": [
        "cdrouter",
        "json",
        "rest",
        "api",
        "client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d7299eef06db750005cd682bb80ae6a9de774684ccac22db82f93c8e486cab67",
                "md5": "34ba31f09e320a731f819238e27036a5",
                "sha256": "09b452eed40fcfa159a1bf6adf1380831c58bfd4e7112d4935c284a42d8f2c72"
            },
            "downloads": -1,
            "filename": "cdrouter-0.9.5-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "34ba31f09e320a731f819238e27036a5",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 61378,
            "upload_time": "2023-08-04T16:06:10",
            "upload_time_iso_8601": "2023-08-04T16:06:10.401153Z",
            "url": "https://files.pythonhosted.org/packages/d7/29/9eef06db750005cd682bb80ae6a9de774684ccac22db82f93c8e486cab67/cdrouter-0.9.5-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e8167c6f6033ce6df4bcc54a62a99e920f1479f779ae06db05b11630ace5fd6",
                "md5": "e36c67b25d7f1a59bbef5081eb831f0e",
                "sha256": "5a4d7313a38098a65a729d53b40fe377b9d9f93869fd2c71b80ef16d2fba96d3"
            },
            "downloads": -1,
            "filename": "cdrouter-0.9.5.tar.gz",
            "has_sig": false,
            "md5_digest": "e36c67b25d7f1a59bbef5081eb831f0e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 43356,
            "upload_time": "2023-08-04T16:06:12",
            "upload_time_iso_8601": "2023-08-04T16:06:12.316906Z",
            "url": "https://files.pythonhosted.org/packages/8e/81/67c6f6033ce6df4bcc54a62a99e920f1479f779ae06db05b11630ace5fd6/cdrouter-0.9.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-04 16:06:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "qacafe",
    "github_project": "cdrouter.py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "tox": true,
    "lcname": "cdrouter"
}
        
Elapsed time: 0.09876s