def test_bad_country(self):
    logging.info('Testing error handling, ignore next few errors')
    state = speedify.show_state()
    self.assertEqual(state, State.LOGGED_IN)
    logging.debug('connecting to bad country')
    with self.assertRaises(SpeedifyAPIError):
        speedify.connect_country('pp')
    logging.debug('after connecting to bad country')
    state = speedify.show_state()
    self.assertEqual(state, State.LOGGED_IN)
    logging.info('Done testing error handling')
def test_bad_country(self):
    logging.info('Testing error handling, ignore next few errors')
    state = speedify.show_state()
    self.assertEqual(state, State.LOGGED_IN)
    logging.debug('connecting to bad country')
    with self.assertRaises(SpeedifyAPIError):
        speedify.connect_country('pp')
    logging.debug('after connecting to bad country')
    state = speedify.show_state()
    self.assertEqual(state, State.LOGGED_IN)
    logging.info('Done testing error handling')