~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_https_urllib.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
        self.build_tree(['cacerts.pem'])
48
48
        path = os.path.join(self.test_dir, "cacerts.pem")
49
49
        stack = self.get_stack("ssl.ca_certs = %s\n" % path)
50
 
        self.assertEquals(path, stack.get('ssl.ca_certs'))
 
50
        self.assertEqual(path, stack.get('ssl.ca_certs'))
51
51
 
52
52
    def test_specified_doesnt_exist(self):
53
53
        stack = self.get_stack('')
59
59
        def warning(*args):
60
60
            self.warnings.append(args[0] % args[1:])
61
61
        self.overrideAttr(trace, 'warning', warning)
62
 
        self.assertEquals(None, stack.get('ssl.ca_certs'))
 
62
        self.assertEqual(None, stack.get('ssl.ca_certs'))
63
63
        self.assertLength(1, self.warnings)
64
64
        self.assertContainsRe(self.warnings[0],
65
65
                              "is not valid for \"ssl.ca_certs\"")
69
69
 
70
70
    def test_default(self):
71
71
        stack = config.MemoryStack("")
72
 
        self.assertEquals(ssl.CERT_REQUIRED, stack.get("ssl.cert_reqs"))
 
72
        self.assertEqual(ssl.CERT_REQUIRED, stack.get("ssl.cert_reqs"))
73
73
 
74
74
    def test_from_string(self):
75
75
        stack = config.MemoryStack("ssl.cert_reqs = none\n")
76
 
        self.assertEquals(ssl.CERT_NONE, stack.get("ssl.cert_reqs"))
 
76
        self.assertEqual(ssl.CERT_NONE, stack.get("ssl.cert_reqs"))
77
77
        stack = config.MemoryStack("ssl.cert_reqs = required\n")
78
 
        self.assertEquals(ssl.CERT_REQUIRED, stack.get("ssl.cert_reqs"))
 
78
        self.assertEqual(ssl.CERT_REQUIRED, stack.get("ssl.cert_reqs"))
79
79
        stack = config.MemoryStack("ssl.cert_reqs = invalid\n")
80
80
        self.assertRaises(ConfigOptionValueError, stack.get, "ssl.cert_reqs")
81
81