示例#1
0
    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")