Browse Source

Add Targets to Events in conformance tests

Stan Janssen 4 years ago
parent
commit
1bf87a2c37

+ 1 - 1
test/conformance/test_conformance_001.py

@@ -34,7 +34,7 @@ async def test_conformance_001():
                                              'request_id': generate_id(),
                                              'event_id': generate_id(),
                                              'modification_number': 1,
-                                             'targets': []})
+                                             'targets': [{'ven_id': '123'}]})
     parsed_type, parsed_msg = parse_message(msg)
     assert parsed_msg['created_date_time'].tzinfo == timezone.utc
     assert parsed_msg['created_date_time'] == dt.astimezone(timezone.utc)

+ 2 - 1
test/conformance/test_conformance_002.py

@@ -56,7 +56,8 @@ async def test_conformance_002():
                   'signal_name': enums.SIGNAL_NAME.SIMPLE,
                   'signal_type': enums.SIGNAL_TYPE.DELTA,
                   'signal_id': generate_id()
-                }]
+                }],
+            'targets': [{'ven_id': '123'}]
         }
 
     # Create a message with this event

+ 2 - 1
test/conformance/test_conformance_006.py

@@ -72,7 +72,8 @@ async def test_conformance_006():
                   'signal_name': enums.SIGNAL_NAME.SIMPLE,
                   'signal_type': enums.SIGNAL_TYPE.DELTA,
                   'signal_id': generate_id()
-                }]
+                }],
+            'targets': [{'ven_id': '123'}]
         }
 
     # Create a message with this event

+ 2 - 1
test/conformance/test_conformance_008.py

@@ -55,7 +55,8 @@ async def test_conformance_008_autocorrect():
                   'signal_name': enums.SIGNAL_NAME.SIMPLE,
                   'signal_type': enums.SIGNAL_TYPE.DELTA,
                   'signal_id': generate_id()
-                }]
+                }],
+            'targets': [{'ven_id': '123'}]
         }
 
     # Create a message with this event

+ 2 - 1
test/conformance/test_conformance_009.py

@@ -54,7 +54,8 @@ async def test_conformance_009_pass():
                   'signal_name': enums.SIGNAL_NAME.SIMPLE,
                   'signal_type': enums.SIGNAL_TYPE.DELTA,
                   'signal_id': generate_id()
-                }]
+                }],
+            'targets': [{'ven_id': '123'}]
         }
 
     # Create a message with this event

+ 2 - 1
test/conformance/test_conformance_014.py

@@ -56,7 +56,8 @@ async def test_conformance_014_warn():
                   'signal_type': enums.SIGNAL_TYPE.DELTA,
                   'signal_id': generate_id(),
                   'current_value': 123
-                }]
+                }],
+            'targets': {'ven_id': '123'}
         }
 
     # Create a message with this event

+ 2 - 1
test/conformance/test_conformance_021.py

@@ -64,7 +64,8 @@ async def test_conformance_021(start_server):
                   'signal_type': enums.SIGNAL_TYPE.DELTA,
                   'signal_id': generate_id(),
                   'current_value': 123
-                }]
+                }],
+            'targets': [{'ven_id': '123'}]
         }
     add_event(ven_id=client.ven_id,
               event_id = event['event_descriptor']['event_id'],

+ 2 - 4
test/test_objects.py

@@ -33,17 +33,15 @@ def test_oadr_event():
             signal_id=1,
             current_value=0
         )],
-        target=objects.Target(
+        targets=[objects.Target(
             ven_id='1234'
-        )
+        )]
     )
 
     response = objects.Response(response_code=200,
                                 response_description='OK',
                                 request_id='1234')
-    pprint(event)
     msg = create_message('oadrDistributeEvent', response=response, events=[event])
-    pprint(msg)
     message_type, message_payload = parse_message(msg)