예제 #1
0
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)
예제 #2
0
def test_update_profile_when_invalid_mrid():
    # We have this to ensure that we are getting good test coverage.
    system = SimulatedSystem()

    profile = gm.GenerationControlProfile()
    system.update_profile("ae8b5a94-fa97-4140-96f1", profile)
예제 #3
0
def test_update_profile_when_mrid_doesnot_exist():
    # We have this to ensure that we are getting good test coverage.
    system = SimulatedSystem()

    profile = gm.GenerationControlProfile()
    system.update_profile("ae8b5a94-fa97-4140-96f1-1b2f6b9255f8", profile)