aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2010-10-23 21:42:45 -0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2010-10-23 21:42:45 -0200
commitc694ffa77b47d1d44fdb1a60c94a50ffd0a3c5a0 (patch)
tree08dc072606e240e59943e63a8aff023cae1913ac /tests
parentactually committing .gitignore (diff)
downloadg-octave-c694ffa77b47d1d44fdb1a60c94a50ffd0a3c5a0.tar.gz
g-octave-c694ffa77b47d1d44fdb1a60c94a50ffd0a3c5a0.tar.bz2
g-octave-c694ffa77b47d1d44fdb1a60c94a50ffd0a3c5a0.zip
fixed the script manage_pkgdb.py and a test case
Diffstat (limited to 'tests')
-rw-r--r--tests/test_description.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/tests/test_description.py b/tests/test_description.py
index ea0be68..9016325 100644
--- a/tests/test_description.py
+++ b/tests/test_description.py
@@ -4,28 +4,31 @@
"""
test_description.py
~~~~~~~~~~~~~~~~~~~
-
+
test suite for the *g_octave.description* module
-
+
:copyright: (c) 2010 by Rafael Goncalves Martins
:license: GPL-2, see LICENSE for more details.
"""
import os
import unittest
+import utils
from g_octave import description
class TestDescription(unittest.TestCase):
-
+
def setUp(self):
+ conf, self._config_file, self._tempdir = utils.create_env()
self.desc = description.Description(
os.path.join(
- os.path.dirname(os.path.abspath(__file__)), 'files', 'DESCRIPTION'
- )
+ os.path.dirname(os.path.abspath(__file__)), 'files', 'DESCRIPTION',
+ ),
+ conf = conf
)
-
+
def test_re_depends(self):
depends = [
('pkg', ('pkg', None, None)),
@@ -156,7 +159,7 @@ class TestDescription(unittest.TestCase):
(match.group(1), match.group(3), match.group(4)),
pkgtpl
)
-
+
def test_re_pkg_atom(self):
depends = [
('pkg-1', ('pkg', '1')),
@@ -182,20 +185,24 @@ class TestDescription(unittest.TestCase):
self.assertEqual(self.desc.description, 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.')
self.assertEqual(self.desc.categories, 'Category1,Category2, Category3')
self.assertEqual(self.desc.url, 'http://example.org')
-
+
requirements = [
'>=g-octave/pkg1-4.3.2',
'<g-octave/pkg2-1.2.3',
'g-octave/pkg3'
]
- requirements.sort()
+ requirements.sort()
self.assertEqual(self.desc.systemrequirements, requirements)
self.assertEqual(self.desc.buildrequires, ['>g-octave/pkg4-1.0.0'])
-
+
self.assertEqual(self.desc.depends, ['>=sci-mathematics/octave-3.0.0'])
self.assertEqual(self.desc.autoload, 'NO')
self.assertEqual(self.desc.license, 'GPL version 3 or later')
+ def tearDown(self):
+ # removing the temp tree
+ utils.clean_env(self._config_file, self._tempdir)
+
def suite():
suite = unittest.TestSuite()