File: test_lp.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 (26 lines) | stat: -rw-r--r-- 637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/python

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

import softwareproperties.ppa

class TestLP(unittest.TestCase):

    def test_ppa_info_from_lp(self):
        # use correct data
        info = softwareproperties.ppa.get_ppa_info_from_lp("mvo", "ppa")
        self.assertNotEqual(info, {})
        self.assertEqual(info["name"], "ppa")
        # use empty CERT file
        softwareproperties.ppa.LAUNCHPAD_PPA_CERT = "/dev/null"
        self.assertRaises(
            pycurl.error, softwareproperties.ppa.get_ppa_info_from_lp, "mvo", "ppa")

        


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