Commit f8b2c348 authored by wilkie's avatar wilkie

Adds test framework and boilerplate for testing.

Adds tox and setup.py for testing in isolated environments and support
for a variety of CI environments.
parent f1fe2bbd
......@@ -4,3 +4,8 @@ config.yml
docs/*.rst
!docs/index.rst
docs/html
tests/.cache
.cache
occam.egg-info
dat
.tox
[pytest]
#addopts = --pyargs occam
testpaths = tests
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import io
from os.path import basename, dirname, join, splitext
from glob import glob
from setuptools import setup, find_packages
setup(name='occam',
version="0.0.1",
packages=find_packages('src'),
package_dir={'': 'src'},
license="AGPL 3",
author="wilkie",
author_email="wilkie@xomb.org",
url="https://gitlab.com/occam-archive/occam",
py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')],
include_package_data=True)
import unittest
from unittest.mock import patch
import occam.objects.manager
class Test__init__(unittest.TestCase):
pass
class TestCapabilities(unittest.TestCase):
def test_should_return_a_capability_manager(self):
self.assertTrue(occam.Occam().capabilities.__class__.__name__ == "CapabilityManager")
class TestNodes(unittest.TestCase):
def test_should_return_a_node_manager(self):
self.assertTrue(occam.Occam().nodes.__class__.__name__ == "NodeManager")
class TestSystem(unittest.TestCase):
def test_should_return_a_system_manager(self):
self.assertTrue(lib.occam.Occam().system.__class__.__name__ == "SystemManager")
class TestJobs(unittest.TestCase):
def test_should_return_a_job_manager(self):
self.assertTrue(lib.occam.Occam().jobs.__class__.__name__ == "JobManager")
class TestResources(unittest.TestCase):
def test_should_return_a_resource_manager(self):
self.assertTrue(lib.occam.Occam().resources.__class__.__name__ == "ResourceManager")
class TestStorage(unittest.TestCase):
def test_should_return_a_storage_manager(self):
self.assertTrue(lib.occam.Occam().storage.__class__.__name__ == "StorageManager")
class TestNetwork(unittest.TestCase):
def test_should_return_an_network_manager(self):
self.assertTrue(lib.occam.Occam().network.__class__.__name__ == "NetworkManager")
class TestObjects(unittest.TestCase):
def test_should_return_an_object_manager(self):
self.assertTrue(lib.occam.Occam().objects.__class__.__name__ == "ObjectManager")
class TestConfiguration(unittest.TestCase):
def test_should_load_configuration(self):
pass
import unittest
from occam.object import Object
#from unittest.mock import patch
class Test__init__(unittest.TestCase):
pass
class TestObject(unittest.TestCase):
def test_initialization(self):
self.assertTrue(
True)
import unittest
from unittest.mock import patch
class Test__init__(unittest.TestCase):
pass
class TestCapabilities(unittest.TestCase):
def test_should_return_a_capability_manager(self):
self.assertTrue(
True)
[tox]
envlist=py36
[testenv]
deps=pytest
commands=pytest
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment