for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import os
import unittest
from msquaredc.project import Project
class PermissionError(IOError):
pass
class FileNotFoundError(IOError):
class WindowsError(IOError):
def cleanup(func):
def call(*args,**kwargs):
try:
if os.path.isfile(func.__name__):
os.remove(func.__name__)
except (PermissionError,FileNotFoundError,WindowsError) as e:
res = func(*args, file=func.__name__,**kwargs)
finally:
except (PermissionError, FileNotFoundError,WindowsError) as e:
return res
return call
class ProjectTest(unittest.TestCase):
"""
@cleanup
def test_init(self,file):
p = Project(data="data.txt", questions="config.yml", coder="MGM", file=file)
def test_integration(self,file):
value = 0
for index,i in enumerate(p):
for j in i.coding_questions:
i[j] = value
value += 1
p.export()