diff options
author | Jauhien Piatlicki (jauhien) <piatlicki@gmail.com> | 2013-09-19 00:47:24 +0200 |
---|---|---|
committer | Jauhien Piatlicki (jauhien) <piatlicki@gmail.com> | 2013-09-19 00:47:24 +0200 |
commit | f83eb1302ee08056a8aa8db6e611b379642043e6 (patch) | |
tree | 36542d3bbf35eb5090f1aaba7d0fbd1095418c1d /tests | |
parent | tests/test_ebuild (diff) | |
download | g-sorcery-f83eb1302ee08056a8aa8db6e611b379642043e6.tar.gz g-sorcery-f83eb1302ee08056a8aa8db6e611b379642043e6.tar.bz2 g-sorcery-f83eb1302ee08056a8aa8db6e611b379642043e6.zip |
tests/test_eclass
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_eclass.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/test_eclass.py b/tests/test_eclass.py new file mode 100644 index 0000000..f336fcb --- /dev/null +++ b/tests/test_eclass.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" + test_eclass.py + ~~~~~~~~~~~~~~ + + eclass test suite + + :copyright: (c) 2013 by Jauhien Piatlicki + :license: GPL-2, see LICENSE for more details. +""" + +import os +import unittest + +from g_sorcery.eclass import EclassGenerator + +from tests.base import BaseTest + + +class TestEclassGenerator(BaseTest): + + def test_eclass_generator(self): + eclasses = ["test1", "test2"] + for eclass in eclasses: + os.system("echo 'eclass " + eclass + "' > " + os.path.join(self.tempdir.name, eclass + ".eclass")) + + eclass_g = EclassGenerator(self.tempdir.name) + self.assertEqual(set(eclass_g.list()), set(eclasses) | set(["g-sorcery"])) + + for eclass in eclasses: + self.assertEqual(eclass_g.generate(eclass), ["eclass " + eclass]) + + +def suite(): + suite = unittest.TestSuite() + suite.addTest(TestEclassGenerator('test_eclass_generator')) + return suite |