~brunonova/ubuntu/precise/software-properties/lp1075537

« back to all changes in this revision

Viewing changes to tests/test_lp.py

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers, Brian Murray, Robert Roth, Marc Deslauriers
  • Date: 2012-02-03 08:16:22 UTC
  • Revision ID: package-import@ubuntu.com-20120203081622-v61p03ezh1ktoeo2
Tags: 0.82.3
[ Brian Murray ]
* when adding new repositories use sourceslist.add instead of append thereby
  preventing duplicate entires.  Thanks to Nick Russo for the patch.
  LP: #854841

[ Robert Roth ]
* Updated expand properties to properly expand the bottom component to avoid
  putting empty space between components. LP: #912557
* Added symbolic link for add-apt-repository manpage under the 
  apt-add-repository name, LP: #620098
* Changed Revert button mnemonic to avoid collision with Remove, LP: #652523
* Handle URLError from ppa pages, instruct the user to check the internet
  connection (LP: #502698)

[ Marc Deslauriers ]
* SECURITY UPDATE: incorrect ssl certificate validation (LP: #915210)
  - softwareproperties/ppa.py: use pycurl to download the signing key
    fingerprint.
  - tests/test_lp.py: add test.
  - debian/control: add python-pycurl dependency.
  - CVE-2011-4407
* Wait for PPA GPG key to get imported before ending thread (LP: #888417)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
import pycurl
 
4
import unittest
 
5
import sys
 
6
sys.path.insert(0, "..")
 
7
 
 
8
import softwareproperties.ppa
 
9
 
 
10
class TestLP(unittest.TestCase):
 
11
 
 
12
    def test_ppa_info_from_lp(self):
 
13
        # use correct data
 
14
        info = softwareproperties.ppa.get_ppa_info_from_lp("mvo", "ppa")
 
15
        self.assertNotEqual(info, {})
 
16
        self.assertEqual(info["name"], "ppa")
 
17
        # use empty CERT file
 
18
        softwareproperties.ppa.LAUNCHPAD_PPA_CERT = "/dev/null"
 
19
        self.assertRaises(
 
20
            pycurl.error, softwareproperties.ppa.get_ppa_info_from_lp, "mvo", "ppa")
 
21
 
 
22
        
 
23
 
 
24
 
 
25
if __name__ == "__main__":
 
26
    unittest.main()