<s> from __future__ import absolute_import <EOL> import unittest <EOL> from pyes . tests import ESTestCase <EOL> from pyes . exceptions import ( NotFoundException , IndexAlreadyExistsException ) <EOL> from pyes import convert_errors <EOL> class RaiseIfErrorTestCase ( ESTestCase ) : <EOL> def test_not_found_exception ( self ) : <EOL> self . assertRaises ( <EOL> NotFoundException , <EOL> convert_errors . raise_if_error , <EOL> <NUM_LIT> , { u'<STR_LIT>' : u'<STR_LIT>' , u'<STR_LIT>' : u'<STR_LIT:1>' , u'<STR_LIT>' : u'<STR_LIT>' } ) <EOL> def test_nested_index_already_exists_exception ( self ) : <EOL> self . assertRaises ( <EOL> IndexAlreadyExistsException , <EOL> convert_errors . raise_if_error , <EOL> <NUM_LIT> , { u'<STR_LIT:status>' : <NUM_LIT> , <EOL> u'<STR_LIT:error>' : ( u'<STR_LIT>' + <EOL> u'<STR_LIT>' + <EOL> u'<STR_LIT>' + <EOL> u'<STR_LIT>' ) } ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
