pertinosdk

Python package for communicating with Pertino.


Keywords
pertino, sdk, api
License
Other
Install
pip install pertinosdk==0.1.1

Documentation

pertinosdk

Welcome to Pertino Python SDK

Example Usage

'''
Created on Jul 26, 2014

@author: lwoydziak
'''
from pertinosdk import PertinoSdk, where
from jsonconfigfile import Env

def test_whenOrgsAvailableThenCanListThem():
    pertinoSdk = PertinoSdk(Env().get("Pertino", "login"), Env().get("Pertino", "password"))
    organizations = pertinoSdk.listOrgs()
    assert len(organizations) > 0

def test_whenDevicesInOrganizationsThenCanListThem():
    pertinoSdk = PertinoSdk(Env().get("Pertino", "login"), Env().get("Pertino", "password"))
    organizations = pertinoSdk.listOrgs()
    devices = pertinoSdk.listDevicesIn(organizations[0])
    assert len(devices) > 0

def test_deleteMachinesWithNameContainingAuto():
    pertinoSdk = PertinoSdk(Env().get("Pertino", "login"), Env().get("Pertino", "password"))
    organizations = pertinoSdk.listOrgs()
    devices = pertinoSdk.listDevicesIn(organizations[0], where("hostName").contains("auto"))
    pertinoSdk.deleteFrom(organizations[0], devices)
    assert not pertinoSdk.listDevicesIn(organizations[0], where("hostName").contains("auto"))

To Build

ant env
ant init
ant package

To run unit tests

ant test

To run acceptance tests

Create a file with your Pertino credentials (see acceptance/conftest.py for format/name)

ant acceptance