~mikemc/ubuntu-sso-client/fix-networkstate-darwin

« back to all changes in this revision

Viewing changes to ubuntu_sso/networkstate/tests/test_darwin.py

  • Committer: mike.mccracken at canonical
  • Date: 2012-05-21 14:48:25 UTC
  • Revision ID: mike.mccracken@canonical.com-20120521144825-o7pl8us0hmhez6qw
style fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    NetworkManagerState
46
46
    )
47
47
 
48
 
 
49
 
class TestException(Exception):
50
 
    """An exception to test error conditions."""
51
 
 
52
48
from ubuntu_sso.networkstate.darwin import flags_say_reachable
53
49
 
 
50
 
54
51
REACHABLE_FLAG = 1 << 1
55
52
CONNECTION_REQUIRED_FLAG = 1 << 2
56
53
 
128
125
    def test_flag_reachable(self):
129
126
        """Reachable by itself is OK."""
130
127
        flag = REACHABLE_FLAG
131
 
        self.assertEqual(True, flags_say_reachable(flag))
 
128
        self.assertTrue(flags_say_reachable(flag))
132
129
 
133
130
    def test_flag_reachable_and_flag_connection_required(self):
134
131
        """Reachable and connection-required is NOT OK"""
135
132
        flag = REACHABLE_FLAG | CONNECTION_REQUIRED_FLAG
136
 
        self.assertEqual(False, flags_say_reachable(flag))
 
133
        self.assertFalse(flags_say_reachable(flag))
137
134
 
138
135
    def test_other_flagvals(self):
139
136
        """All other flag configurations are false for our purposes.