File: test_whitelist_adding.py

package info (click to toggle)
software-properties 0.82.7.1debian1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 4,680 kB
  • sloc: python: 3,982; xml: 1,571; makefile: 19
file content (20 lines) | stat: -rw-r--r-- 698 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/python

import unittest
import sys
sys.path.insert(0, "../")

from softwareproperties.SoftwareProperties import SoftwareProperties

class TestWhitelist(unittest.TestCase):
    def testCheckAndAddKey(self):
        sp = SoftwareProperties()
        line = "deb http://xxx/cial jaunty main"
        self.assert_(sp._is_line_in_whitelisted_channel(line) is None)
        line = "deb http://archive.canonical.com/ubuntu jaunty partner"
        self.assert_(sp._is_line_in_whitelisted_channel(line) is not None)
        line = "deb http://archive.canonical.com/ubuntu jaunty partner"
        sp.check_and_add_key_for_whitelisted_channels(line)

if __name__ == "__main__":
    unittest.main()