summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2012-05-21 17:18:57 +0200
committerDidier Raboud <odyx@debian.org>2012-05-21 17:18:57 +0200
commitac03eb668ff769e2ef9cf792f5000e9dc753042c (patch)
treef056b6a8ef7f0e7d31a35dafa13d7a6f043c60f5 /test
parentce9dcceef7745798cf92b2aac03164818b79ce63 (diff)
PyUT: Implement test for lsb_release.parse_policy_line.
Diffstat (limited to 'test')
-rw-r--r--test/test_lsb_release.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/test_lsb_release.py b/test/test_lsb_release.py
index 8a1dfb8..9c5f2c2 100644
--- a/test/test_lsb_release.py
+++ b/test/test_lsb_release.py
@@ -60,9 +60,18 @@ class TestLSBRelease(unittest.TestCase):
@unittest.skip('Test not implemented.')
def test_check_modules_installed(self):
raise NotImplementedError()
- @unittest.skip('Test not implemented.')
+
def test_parse_policy_line(self):
- raise NotImplementedError()
+ release_line = ''
+ shortnames = lr.longnames.keys()
+ random.shuffle(shortnames)
+ longnames = {}
+ for shortname in shortnames:
+ longnames[lr.longnames[shortname]] = ''.join( [random.choice(string.letters) for i in xrange(random.randint(1,9))])
+ release_line += shortname + '=' + longnames[lr.longnames[shortname]] + ','
+ release_line = string.strip(release_line,',')
+ self.assertEqual(sorted(lr.parse_policy_line(release_line)),sorted(longnames),'parse_policy_line(' + release_line + ')')
+
@unittest.skip('Test not implemented.')
def test_compare_release(self):
raise NotImplementedError()