PyCIRCLean/tests/test.py

52 lines
1.4 KiB
Python
Raw Normal View History

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
2015-10-27 14:53:33 +01:00
import os
2015-10-27 10:23:04 +01:00
from bin.specific import KittenGroomerSpec
2015-10-27 10:50:46 +01:00
from bin.pier9 import KittenGroomerPier9
from bin.generic import KittenGroomer
2015-10-27 14:10:56 +01:00
from kittengroomer import FileBase
class TestBasic(unittest.TestCase):
def setUp(self):
self.maxDiff = None
2015-10-27 14:53:33 +01:00
self.curpath = os.getcwd()
2015-10-27 16:51:03 +01:00
def test_specific_valid(self):
src = os.path.join(self.curpath, 'tests/src2')
dst = os.path.join(self.curpath, 'tests/dst')
spec = KittenGroomerSpec(src, dst)
spec.processdir()
def test_specific_invalid(self):
2015-10-27 14:53:33 +01:00
src = os.path.join(self.curpath, 'tests/src')
dst = os.path.join(self.curpath, 'tests/dst')
spec = KittenGroomerSpec(src, dst)
2015-10-27 10:23:04 +01:00
spec.processdir()
2015-10-27 10:50:46 +01:00
def test_pier9(self):
2015-10-27 14:53:33 +01:00
src = os.path.join(self.curpath, 'tests/src')
dst = os.path.join(self.curpath, 'tests/dst')
spec = KittenGroomerPier9(src, dst)
2015-10-27 10:50:46 +01:00
spec.processdir()
def test_generic(self):
2015-10-27 14:53:33 +01:00
src = os.path.join(self.curpath, 'tests/src')
dst = os.path.join(self.curpath, 'tests/dst')
spec = KittenGroomer(src, dst)
2015-10-27 10:50:46 +01:00
spec.processdir()
2015-10-27 14:10:56 +01:00
def test_help_file(self):
f = FileBase('tests/src/blah.conf', 'tests/dst/blah.conf')
f.make_unknown()
f.make_binary()
f.make_unknown()
f.make_dangerous()
f.make_binary()
f.make_dangerous()