diff options
author | Didier Raboud <odyx@debian.org> | 2012-05-21 17:18:57 +0200 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2012-05-21 17:18:57 +0200 |
commit | ac03eb668ff769e2ef9cf792f5000e9dc753042c (patch) | |
tree | f056b6a8ef7f0e7d31a35dafa13d7a6f043c60f5 /test | |
parent | ce9dcceef7745798cf92b2aac03164818b79ce63 (diff) |
PyUT: Implement test for lsb_release.parse_policy_line.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_lsb_release.py | 13 |
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() |