class OrloClientTest(TestCase): """ Parent method for Orlo client tests Constants in this class are test parameters for Orlo methods """ NOTE = 'test note' PLATFORMS = ['test_platform'] REFERENCES = ['test_reference'] TEAM = 'test_team' URI = 'http://localhost:1337' USER = '******' CLIENT = MockOrloClient('http://dummy.example.com') RELEASE = Release(CLIENT, str(uuid.uuid4())) PACKAGE = RELEASE.packages[0] def setUp(self): self.orlo = OrloClient(self.URI)
from __future__ import print_function from tests import OrloClientTest from orloclient.mock_orlo import MockOrloClient from orloclient import Package, Release from orloclient.exceptions import ClientError import arrow import uuid __author__ = 'alforbes' client = MockOrloClient('http://dummy.example.com') class TestPackage(OrloClientTest): def setUp(self): self.rid = client.example_release_dict['id'] self.pid = client.example_package_dict['id'] self.release = Release(client, self.rid) self.package = self.release.packages[0] def test_package_id(self): """ Test that the package id returned matches the one from the mock and is a UUID """ self.assertIsInstance(self.package.id, uuid.UUID) self.assertEqual(self.package.id, uuid.UUID(self.pid)) def test_package_stime(self): """ Test that stime is cast to an arrow object """
def setUp(self): self.mock_client = MockOrloClient(uri='http://dummy')