def test_other_flagvals(self):
        """All other flag configurations are false for our purposes.

        They either indicate an iOS device, which we won't run this
        code on, or that the server we're testing for is on this
        machine or wired directly to it. These cases won't happen.
        """
        for flag in range(0, 17) + [1 << 16, 1 << 17, 1 << 18]:
            # only test cases without the reachable bit set:
            flag = flag & ~2
            self.assertEqual(False, flags_say_reachable(flag))
 def test_flag_reachable_and_flag_connection_required(self):
     """Reachable and connection-required is NOT OK"""
     flag = REACHABLE_FLAG | CONNECTION_REQUIRED_FLAG
     self.assertFalse(flags_say_reachable(flag))
 def test_flag_reachable(self):
     """Reachable by itself is OK."""
     flag = REACHABLE_FLAG
     self.assertTrue(flags_say_reachable(flag))