From: Didier Raboud Date: Mon, 21 May 2012 15:18:57 +0000 (+0200) Subject: PyUT: Implement test for lsb_release.parse_policy_line. X-Git-Tag: archive/raspbian/10.2018112800+rpi1^2~126 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ac03eb668ff769e2ef9cf792f5000e9dc753042c;p=lsb.git PyUT: Implement test for lsb_release.parse_policy_line. --- 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()