<s> from pyoanda . exceptions import BadRequest <EOL> from . integration_test_case import IntegrationTestCase <EOL> class TestOrderAPI ( IntegrationTestCase ) : <EOL> def test_get_orders ( self ) : <EOL> assert self . client . get_orders ( ) <EOL> def test_get_order ( self ) : <EOL> order = self . build_order ( ) <EOL> result = self . client . create_order ( order ) <EOL> assert self . client . get_order ( result [ '<STR_LIT>' ] [ '<STR_LIT:id>' ] ) <EOL> assert self . client . get_order ( order_id = result [ '<STR_LIT>' ] [ '<STR_LIT:id>' ] ) <EOL> def test_create_order ( self ) : <EOL> order = self . build_order ( ) <EOL> assert self . client . create_order ( order ) <EOL> def test_update_order ( self ) : <EOL> order = self . build_order ( ) <EOL> result = self . client . create_order ( order ) <EOL> assert self . client . update_order ( result [ '<STR_LIT>' ] [ '<STR_LIT:id>' ] , order ) <EOL> def test_close_order ( self ) : <EOL> order = self . build_order ( ) <EOL> result = self . client . create_order ( order ) <EOL> assert self . client . close_order ( result [ '<STR_LIT>' ] [ '<STR_LIT:id>' ] ) <EOL> with self . assertRaises ( BadRequest ) : <EOL> self . client . close_order ( result [ '<STR_LIT>' ] [ '<STR_LIT:id>' ] ) <EOL> with self . assertRaises ( BadRequest ) : <EOL> self . client . get_order ( result [ '<STR_LIT>' ] [ '<STR_LIT:id>' ] ) </s>
