added dummy class and began writing unit tests

This commit is contained in:
tylerlaberge
2016-07-17 19:06:26 -04:00
parent 49ad3c0a6e
commit d67889327c
8 changed files with 104 additions and 0 deletions

0
tests/utils/__init__.py Normal file
View File

View File

@@ -0,0 +1,27 @@
from types import MethodType
class DummyClass(object):
"""
Class representing dummy data.
"""
def __init__(self, attributes, functions):
"""
Initialize a new DummyClass instance.
@param attributes: A dictionary of instance variables for this dummy instance.
@type attributes: dict
@param functions: A dictionary of functions for this dummy instance.
@type functions: dict
"""
for key, value in attributes.items():
if callable(value):
raise ValueError
else:
setattr(self, key, value)
for key, value in functions.items():
if not callable(value):
raise ValueError
else:
setattr(self, key, MethodType(value, self))