def test_GIVEN_majic_is_down_WHEN_get_file_properties_THEN_exception_thrown(self): config = ConfigMother.incorrect_webservice_configured() client = MajicWebserviceClient(config) assert_that( calling(client.get_properties_list), raises(WebserviceClientError, "There is a connection error when contacting the Majic Web Service"))
def test_GIVEN_majic_is_down_WHEN_sync_THEN_error_message_returned(self): config = ConfigMother.incorrect_webservice_configured() sync = Synchroniser(config) result = sync.synchronise() assert_that(result, is_not(0))
def test_GIVEN_majic_client_throws_an_unknown_exception_WHEN_synch_THEN_error_code_returned(self): error_message = "error_message" config = ConfigMother.incorrect_webservice_configured() client = Mock(MajicWebserviceClient) client.get_properties_list_with_filtered_users = Mock(side_effect=Exception(error_message)) sync = Synchroniser(config, client) result = sync.synchronise() assert_that(result, is_not(0), "error code")