<s> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> try : <EOL> from unittest import mock <EOL> except ImportError : <EOL> import mock <EOL> from pyoanda . client import Client <EOL> class TestAccountAPI ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> with mock . patch . object ( Client , '<STR_LIT>' , return_value = True ) : <EOL> self . client = Client ( <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ) <EOL> def test_create_account ( self ) : <EOL> with mock . patch . object ( Client , '<STR_LIT>' , return_value = True ) : <EOL> assert self . client . create_account ( ) <EOL> def test_create_account_with_currency ( self ) : <EOL> with mock . patch . object ( Client , '<STR_LIT>' , return_value = True ) : <EOL> assert self . client . create_account ( '<STR_LIT>' ) <EOL> assert self . client . create_account ( currency = '<STR_LIT>' ) <EOL> def test_get_accounts ( self ) : <EOL> with mock . patch . object ( Client , '<STR_LIT>' , return_value = True ) : <EOL> assert self . client . get_accounts ( ) <EOL> def test_get_accounts_with_username ( self ) : <EOL> with mock . patch . object ( Client , '<STR_LIT>' , return_value = True ) : <EOL> assert self . client . get_accounts ( '<STR_LIT>' ) <EOL> assert self . client . get_accounts ( username = '<STR_LIT>' ) </s>
