aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2010-05-29 03:47:08 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2010-05-29 03:47:08 -0300
commit152e1a07d0afd2e50dd6897d88ed0d848d003390 (patch)
treecafed64da5e816859ef07471f9448f508cce5d1f /tests/test_ebuild.py
parentremoved the method to create a g_octave.DescriptionTree object from the modul... (diff)
downloadg-octave-152e1a07d0afd2e50dd6897d88ed0d848d003390.tar.gz
g-octave-152e1a07d0afd2e50dd6897d88ed0d848d003390.tar.bz2
g-octave-152e1a07d0afd2e50dd6897d88ed0d848d003390.zip
fixed tests to g_octave.overlay. added tests to g_octave.ebuild (tests/test_ebuild.py)
Diffstat (limited to 'tests/test_ebuild.py')
-rw-r--r--tests/test_ebuild.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/test_ebuild.py b/tests/test_ebuild.py
new file mode 100644
index 0000000..5e0c629
--- /dev/null
+++ b/tests/test_ebuild.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""
+ test_ebuild.py
+ ~~~~~~~~~~~~~~
+
+ test suite for the *g_octave.ebuild* module
+
+ :copyright: (c) 2010 by Rafael Goncalves Martins
+ :license: GPL-2, see LICENSE for more details.
+"""
+
+import unittest
+import utils
+
+from g_octave import ebuild
+
+
+class TestEbuild(unittest.TestCase):
+
+ def setUp(self):
+ self._config, self._config_file, self._dir = utils.create_env()
+
+ def test_re_keywords(self):
+ keywords = [
+ ('alpha', (None, 'alpha')),
+ ('amd64', (None, 'amd64')),
+ ('hppa', (None, 'hppa')),
+ ('ppc', (None, 'ppc')),
+ ('ppc64', (None, 'ppc64')),
+ ('sparc', (None, 'sparc')),
+ ('x86', (None, 'x86')),
+ ('~alpha', ('~', 'alpha')),
+ ('~amd64', ('~', 'amd64')),
+ ('~hppa', ('~', 'hppa')),
+ ('~ppc', ('~', 'ppc')),
+ ('~ppc64', ('~', 'ppc64')),
+ ('~sparc', ('~', 'sparc')),
+ ('~x86', ('~', 'x86')),
+ ]
+
+ for kwstr, kwtpl in keywords:
+ match = ebuild.re_keywords.match(kwstr)
+ self.assertEqual(
+ (match.group(1), match.group(2)),
+ kwtpl
+ )
+
+ def tearDown(self):
+ utils.clean_env(self._config_file, self._dir)
+
+
+def suite():
+ suite = unittest.TestSuite()
+ suite.addTest(TestEbuild('test_re_keywords'))
+ return suite