@@ -15,35 +15,38 @@ def home():
1515 except IndexError :
1616 raise ValueError ("The instanciated demo account does not have any homes. Cannot perform home tests." )
1717
18- def test_production_page_info (home ):
19- home_production_connection = home .fetch_production ("HOURLY" , first = 10 , after = "MjAyMi0wNi0xNFQxMzowMDowMC4wMDArMDI6MDA=" )
20- page_info = home_production_connection .page_info
21-
22- assert page_info .end_cursor == home_production_connection .edges [- 1 ].cursor
23- assert page_info .has_next_page
24- assert page_info .has_previous_page
25- assert page_info .start_cursor == home_production_connection .edges [0 ].cursor
26-
27- assert page_info .count == 10
28- assert page_info .currency == "NOK"
29- assert page_info .total_profit == 0.73834817
30- assert page_info .total_production == 5.49
31- assert page_info .filtered == 0
32-
33- def test_production_nodes (home ):
34- home_production_connection = home .fetch_production ("HOURLY" , last = 5 )
35- history = home_production_connection .nodes
36-
37- for i , hour in enumerate (history ):
38- from_time = datetime .strptime (hour .from_time , "%Y-%m-%dT%H:%M:%S.%f%z" )
39- to_time = datetime .strptime (hour .to_time , "%Y-%m-%dT%H:%M:%S.%f%z" )
40-
41- ft = datetime .now ().astimezone ().replace (minute = 0 , second = 0 , microsecond = 0 )
42- ft -= timedelta (hours = 1 + (4 - i ))
43- tt = datetime .now ().astimezone ().replace (minute = 0 , second = 0 , microsecond = 0 )
44- tt -= timedelta (hours = (4 - i ))
45-
46- assert from_time == ft
47- assert to_time == tt
48-
49- assert [node .production_unit == "kWh" for node in history ]
18+
19+ # DISABLED in version 0.1.1 because the demo account has no power production...
20+
21+ # def test_production_page_info(home):
22+ # home_production_connection = home.fetch_production("HOURLY", first=10, after="MjAyMi0wNi0xNFQxMzowMDowMC4wMDArMDI6MDA=")
23+ # page_info = home_production_connection.page_info
24+
25+ # assert page_info.end_cursor == home_production_connection.edges[-1].cursor
26+ # assert page_info.has_next_page
27+ # assert page_info.has_previous_page
28+ # assert page_info.start_cursor == home_production_connection.edges[0].cursor
29+
30+ # assert page_info.count == 10
31+ # assert page_info.currency == "NOK"
32+ # assert page_info.total_profit == 0.73834817
33+ # assert page_info.total_production == 5.49
34+ # assert page_info.filtered == 0
35+
36+ # def test_production_nodes(home):
37+ # home_production_connection = home.fetch_production("HOURLY", last=5)
38+ # history = home_production_connection.nodes
39+
40+ # for i, hour in enumerate(history):
41+ # from_time = datetime.strptime(hour.from_time, "%Y-%m-%dT%H:%M:%S.%f%z")
42+ # to_time = datetime.strptime(hour.to_time, "%Y-%m-%dT%H:%M:%S.%f%z")
43+
44+ # ft = datetime.now().astimezone().replace(minute=0, second=0, microsecond=0)
45+ # ft -= timedelta(hours=1+(4 - i))
46+ # tt = datetime.now().astimezone().replace(minute=0, second=0, microsecond=0)
47+ # tt -= timedelta(hours=(4 - i))
48+
49+ # assert from_time == ft
50+ # assert to_time == tt
51+
52+ # assert [node.production_unit == "kWh" for node in history]
0 commit comments