def test_update_profile_when_mrid_matches_device(): # We have this to ensure that we are getting good test coverage. device_mrid = uuid.uuid4() battery = Mock(mrid=device_mrid) system = SimulatedSystem() system.add_model(battery) profile = gm.GenerationControlProfile() profile.generatingUnit.conductingEquipment.mRID = str(device_mrid) system.update_profile(str(device_mrid), profile) battery.update_profile.assert_called_once_with(profile)
def test_remove_model_when_exists(): system = SimulatedSystem() battery = SinglePhaseGenerator() uuid = system.add_model(battery) assert system.remove_model(uuid) assert len(system.devices) == 0 assert len(system.subscriptions) == 0