Skip to content

Commit d20761b

Browse files
committed
remove test and format json
1 parent 864abb3 commit d20761b

File tree

3 files changed

+99
-155
lines changed

3 files changed

+99
-155
lines changed
Lines changed: 99 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,101 @@
11
{
2-
"request_id": "abc123",
3-
"results": [{
4-
"branding": {
5-
"icon_url": "https://api.polygon.io/icon.png",
6-
"logo_url": "https://api.polygon.io/logo.svg"
7-
},
8-
"market_status": "closed",
9-
"name": "Norwegian Cruise Lines",
10-
"price": 22.3,
11-
"session": {
12-
"change": -1.05,
13-
"change_percent": -4.67,
14-
"close": 21.4,
15-
"early_trading_change": -0.39,
16-
"early_trading_change_percent": -0.07,
17-
"high": 22.49,
18-
"late_trading_change": 1.2,
19-
"late_trading_change_percent": 3.92,
20-
"low": 21.35,
21-
"open": 22.49,
22-
"previous_close": 22.45,
23-
"volume": 37
24-
},
25-
"ticker": "NCLH",
26-
"type": "stocks"
27-
}, {
28-
"market_status": "closed",
29-
"name": "NCLH $5 Call",
30-
"options": {
31-
"contract_type": "call",
32-
"exercise_style": "american",
33-
"expiration_date": "2022-10-14",
34-
"shares_per_contract": 100,
35-
"strike_price": 5,
36-
"underlying_ticker": "NCLH"
37-
},
38-
"price": 6.6,
39-
"session": {
40-
"change": -0.05,
41-
"change_percent": -1.07,
42-
"close": 6.65,
43-
"early_trading_change": -0.01,
44-
"early_trading_change_percent": -0.03,
45-
"high": 7.01,
46-
"late_trading_change": -0.4,
47-
"late_trading_change_percent": -0.02,
48-
"low": 5.42,
49-
"open": 6.7,
50-
"previous_close": 6.71,
51-
"volume": 67
52-
},
53-
"ticker": "O:NCLH221014C00005000",
54-
"type": "option"
55-
}, {
56-
"market_status": "open",
57-
"name": "Euro - United States Dollar",
58-
"price": 0.97989,
59-
"session": {
60-
"change": -0.0001,
61-
"change_percent": -0.67,
62-
"close": 0.97989,
63-
"high": 0.98999,
64-
"low": 0.96689,
65-
"open": 0.97889,
66-
"previous_close": 0.98001
67-
},
68-
"ticker": "C:EURUSD",
69-
"type": "fx"
70-
}, {
71-
"branding": {
72-
"icon_url": "https://api.polygon.io/icon.png",
73-
"logo_url": "https://api.polygon.io/logo.svg"
74-
},
75-
"market_status": "open",
76-
"name": "Bitcoin - United States Dollar",
77-
"price": 32154.68,
78-
"session": {
79-
"change": -201.23,
80-
"change_percent": -0.77,
81-
"close": 32154.68,
82-
"high": 33124.28,
83-
"low": 28182.88,
84-
"open": 31129.32,
85-
"previous_close": 33362.18
86-
},
87-
"ticker": "X:BTCUSD",
88-
"type": "crypto"
89-
}, {
90-
"error": "NOT_FOUND",
91-
"message": "Ticker not found.",
92-
"ticker": "APx"
93-
}],
94-
"status": "OK"
2+
"request_id":"abc123",
3+
"results":[
4+
{
5+
"branding":{
6+
"icon_url":"https://api.polygon.io/icon.png",
7+
"logo_url":"https://api.polygon.io/logo.svg"
8+
},
9+
"market_status":"closed",
10+
"name":"Norwegian Cruise Lines",
11+
"price":22.3,
12+
"session":{
13+
"change":-1.05,
14+
"change_percent":-4.67,
15+
"close":21.4,
16+
"early_trading_change":-0.39,
17+
"early_trading_change_percent":-0.07,
18+
"high":22.49,
19+
"late_trading_change":1.2,
20+
"late_trading_change_percent":3.92,
21+
"low":21.35,
22+
"open":22.49,
23+
"previous_close":22.45,
24+
"volume":37
25+
},
26+
"ticker":"NCLH",
27+
"type":"stocks"
28+
},
29+
{
30+
"market_status":"closed",
31+
"name":"NCLH $5 Call",
32+
"options":{
33+
"contract_type":"call",
34+
"exercise_style":"american",
35+
"expiration_date":"2022-10-14",
36+
"shares_per_contract":100,
37+
"strike_price":5,
38+
"underlying_ticker":"NCLH"
39+
},
40+
"price":6.6,
41+
"session":{
42+
"change":-0.05,
43+
"change_percent":-1.07,
44+
"close":6.65,
45+
"early_trading_change":-0.01,
46+
"early_trading_change_percent":-0.03,
47+
"high":7.01,
48+
"late_trading_change":-0.4,
49+
"late_trading_change_percent":-0.02,
50+
"low":5.42,
51+
"open":6.7,
52+
"previous_close":6.71,
53+
"volume":67
54+
},
55+
"ticker":"O:NCLH221014C00005000",
56+
"type":"option"
57+
},
58+
{
59+
"market_status":"open",
60+
"name":"Euro - United States Dollar",
61+
"price":0.97989,
62+
"session":{
63+
"change":-0.0001,
64+
"change_percent":-0.67,
65+
"close":0.97989,
66+
"high":0.98999,
67+
"low":0.96689,
68+
"open":0.97889,
69+
"previous_close":0.98001
70+
},
71+
"ticker":"C:EURUSD",
72+
"type":"fx"
73+
},
74+
{
75+
"branding":{
76+
"icon_url":"https://api.polygon.io/icon.png",
77+
"logo_url":"https://api.polygon.io/logo.svg"
78+
},
79+
"market_status":"open",
80+
"name":"Bitcoin - United States Dollar",
81+
"price":32154.68,
82+
"session":{
83+
"change":-201.23,
84+
"change_percent":-0.77,
85+
"close":32154.68,
86+
"high":33124.28,
87+
"low":28182.88,
88+
"open":31129.32,
89+
"previous_close":33362.18
90+
},
91+
"ticker":"X:BTCUSD",
92+
"type":"crypto"
93+
},
94+
{
95+
"error":"NOT_FOUND",
96+
"message":"Ticker not found.",
97+
"ticker":"APx"
98+
}
99+
],
100+
"status":"OK"
95101
}

test_rest/mocks/v1/summaries&ticker.any_of=NCLH.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

test_rest/test_summaries.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,6 @@
33

44

55
class SummariesTest(BaseTest):
6-
def test_get_summaries(self):
7-
ticker_any_of = ["NCLH"]
8-
summary_results = self.c.get_summaries(ticker_any_of)
9-
expected = [
10-
SummaryResult(
11-
price=22.3,
12-
name="Norwegian Cruise Lines",
13-
ticker="NCLH",
14-
branding=Branding(
15-
icon_url="https://api.polygon.io/icon.png",
16-
logo_url="https://api.polygon.io/logo.svg",
17-
),
18-
market_status="closed",
19-
type="stocks",
20-
session=Session(
21-
change=-1.05,
22-
change_percent=-4.67,
23-
close=21.4,
24-
early_trading_change=-0.39,
25-
early_trading_change_percent=-0.07,
26-
high=22.49,
27-
late_trading_change=1.2,
28-
late_trading_change_percent=3.92,
29-
low=21.35,
30-
open=22.49,
31-
previous_close=22.45,
32-
volume=37,
33-
),
34-
)
35-
]
36-
self.assertEqual(summary_results, expected)
376

387
def test_get_summaries_list(self):
398
ticker_any_of = ["NCLH", "O:NCLH221014C00005000", "C:EURUSD", "X:BTCUSD", "APx"]

0 commit comments

Comments
 (0)