~ahasenack/landscape-client/landscape-client-testing

« back to all changes in this revision

Viewing changes to landscape/broker/tests/test_config.py

  • Committer: Jerry Seutter
  • Date: 2011-07-06 21:36:00 UTC
  • mfrom: (338.2.3 assert-equal)
  • Revision ID: jerry.seutter@canonical.com-20110706213600-x1dl4vcp47dffaml
Test file refactoring only.  Refactored assertEquals -> assertEqual and 
did some PEP8 and lint cleanups.
[r=ack,free] [f=805746]

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
        configuration.load(["--http-proxy", "foo",
23
23
                            "--https-proxy", "bar",
24
24
                            "--url", "whatever"])
25
 
        self.assertEquals(os.environ["http_proxy"], "foo")
26
 
        self.assertEquals(os.environ["https_proxy"], "bar")
 
25
        self.assertEqual(os.environ["http_proxy"], "foo")
 
26
        self.assertEqual(os.environ["https_proxy"], "bar")
27
27
 
28
28
    def test_loading_without_http_proxies_does_not_touch_environment(self):
29
29
        """
36
36
 
37
37
        configuration = BrokerConfiguration()
38
38
        configuration.load(["--url", "whatever"])
39
 
        self.assertEquals(os.environ["http_proxy"], "heyo")
40
 
        self.assertEquals(os.environ["https_proxy"], "baroo")
 
39
        self.assertEqual(os.environ["http_proxy"], "heyo")
 
40
        self.assertEqual(os.environ["https_proxy"], "baroo")
41
41
 
42
42
    def test_loading_resets_http_proxies(self):
43
43
        """
55
55
        configuration.load(["--http-proxy", "x",
56
56
                            "--https-proxy", "y",
57
57
                            "--url", "whatever"])
58
 
        self.assertEquals(os.environ["http_proxy"], "x")
59
 
        self.assertEquals(os.environ["https_proxy"], "y")
 
58
        self.assertEqual(os.environ["http_proxy"], "x")
 
59
        self.assertEqual(os.environ["https_proxy"], "y")
60
60
 
61
61
        configuration.load(["--url", "whatever"])
62
 
        self.assertEquals(os.environ["http_proxy"], "original")
63
 
        self.assertEquals(os.environ["https_proxy"], "originals")
 
62
        self.assertEqual(os.environ["http_proxy"], "original")
 
63
        self.assertEqual(os.environ["https_proxy"], "originals")
64
64
 
65
65
    def test_intervals_are_ints(self):
66
66
        """
74
74
        configuration = BrokerConfiguration()
75
75
        configuration.load(["--config", filename, "--url", "whatever"])
76
76
 
77
 
        self.assertEquals(configuration.urgent_exchange_interval, 12)
78
 
        self.assertEquals(configuration.exchange_interval, 34)
 
77
        self.assertEqual(configuration.urgent_exchange_interval, 12)
 
78
        self.assertEqual(configuration.exchange_interval, 34)