finish test_path.test_type_detection

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-10-04 18:36:43 +02:00
parent 8dd248cf76
commit f88cb78d61

View file

@ -40,14 +40,17 @@ class Path(unittest.TestCase):
os.mkdir(self.path.conf_dir) os.mkdir(self.path.conf_dir)
os.mkdir(self.path.type_base_dir) os.mkdir(self.path.type_base_dir)
self.install_type_name = "__install_test"
self.config_type_name = "__config_test"
# Create install type # Create install type
self.install_type = os.path.join(self.path.type_base_dir, "__install_test") self.install_type = os.path.join(self.path.type_base_dir, self.install_type_name)
os.mkdir(self.install_type) os.mkdir(self.install_type)
open(os.path.join(self.install_type, "install"), "w").close() open(os.path.join(self.install_type, "install"), "w").close()
# Create config type # Create config type
config_type = os.path.join(self.path.type_base_dir, "__config_test") self.config_type = os.path.join(self.path.type_base_dir, self.config_type_name)
os.mkdir(config_type) os.mkdir(self.config_type)
def tearDown(self): def tearDown(self):
self.path.cleanup() self.path.cleanup()
@ -56,6 +59,8 @@ class Path(unittest.TestCase):
def test_type_detection(self): def test_type_detection(self):
"""Check that a type is identified as install or configuration correctly""" """Check that a type is identified as install or configuration correctly"""
self.assertTrue(self.path.is_install_type(self.install_type))
self.assertFalse(self.path.is_install_type(self.config_type))
def test_manifest_uses_install_types_only(self): def test_manifest_uses_install_types_only(self):
"""Check that objects created from manifest are only of install type""" """Check that objects created from manifest are only of install type"""