@@ -335,7 +335,8 @@ def test_data(reqmock):
335335def test_watchlists (reqmock ):
336336 api = tradeapi .REST ('key-id' , 'secret-key' , api_version = 'v1' )
337337 # get watchlists
338- reqmock .get ('https://api.alpaca.markets/v1/watchlists' ,
338+ reqmock .get (
339+ 'https://api.alpaca.markets/v1/watchlists' ,
339340 text = '''[
340341 {
341342 "id": "900e20b1-46eb-492b-a505-2ea67386b5fd",
@@ -367,8 +368,9 @@ def test_watchlists(reqmock):
367368 # get a watchlist by watchlist_id
368369 watchlist_id = "e65f2f2d-b596-4db6-bd68-1b7ceb77cccc"
369370 symbol = "AMD"
370- reqmock .get ('https://api.alpaca.markets/v1/watchlists/{}' .format (watchlist_id ),
371- text = '''{
371+ reqmock .get (
372+ 'https://api.alpaca.markets/v1/watchlists/{}' .format (watchlist_id ),
373+ text = '''{
372374 "id": "e65f2f2d-b596-4db6-bd68-1b7ceb77cccc",
373375 "account_id": "1f893862-13b5-4603-b3ca-513980c00c6e",
374376 "created_at": "2020-01-23T00:52:07.049138Z",
@@ -440,8 +442,9 @@ def test_watchlists(reqmock):
440442 assert watchlist .assets [0 ]["easy_to_borrow" ]
441443
442444 # add an asset to a watchlist
443- reqmock .post ('https://api.alpaca.markets/v1/watchlists/{}' .format (watchlist_id ),
444- text = '''{
445+ reqmock .post (
446+ 'https://api.alpaca.markets/v1/watchlists/{}' .format (watchlist_id ),
447+ text = '''{
445448 "id": "e65f2f2d-b596-4db6-bd68-1b7ceb77cccc",
446449 "account_id": "1f893862-13b5-4603-b3ca-513980c00c6e",
447450 "created_at": "2020-01-23T00:52:07.049138Z",
@@ -468,8 +471,11 @@ def test_watchlists(reqmock):
468471 assert watchlist .assets [0 ]["symbol" ] == "AMD"
469472
470473 # remove an item from a watchlist
471- reqmock .delete ('https://api.alpaca.markets/v1/watchlists/{}/{}' .format (watchlist_id , symbol ),
472- text = '''{
474+ reqmock .delete (
475+ 'https://api.alpaca.markets/v1/watchlists/{}/{}' .format (
476+ watchlist_id , symbol
477+ ),
478+ text = '''{
473479 "id": "e65f2f2d-b596-4db6-bd68-1b7ceb77cccc",
474480 "account_id": "1f893862-13b5-4603-b3ca-513980c00c6e",
475481 "created_at": "2020-01-23T00:52:07.049138Z",
@@ -525,7 +531,7 @@ def test_watchlists(reqmock):
525531 "easy_to_borrow": true
526532 }
527533 ]
528- }''' )
534+ }''' )
529535 api .delete_from_watchlist (watchlist_id , symbol )
530536
531537 # delete a watchlist
0 commit comments