Skip to content

Commit e740405

Browse files
Updated tests.
Signed-off-by: Roberto Marquez <roberto.marquez@zepben.com>
1 parent e3d4126 commit e740405

1 file changed

Lines changed: 19 additions & 139 deletions

File tree

test/test_eas_client.py

Lines changed: 19 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,8 @@ def test_run_hosting_capacity_calibration_no_verify_success(httpserver: HTTPServ
627627
verify_certificate=False
628628
)
629629

630-
httpserver.expect_oneshot_request("/api/graphql").respond_with_handler(hosting_capacity_run_calibration_request_handler)
630+
httpserver.expect_oneshot_request("/api/graphql").respond_with_handler(
631+
hosting_capacity_run_calibration_request_handler)
631632
res = eas_client.run_hosting_capacity_calibration("TEST CALIBRATION", datetime(2025, month=7, day=12))
632633
httpserver.check_assertions()
633634
assert res == {"result": "success"}
@@ -807,7 +808,8 @@ def test_run_hosting_capacity_calibration_with_calibration_time_no_verify_succes
807808
assert res == {"result": "success"}
808809

809810

810-
def test_run_hosting_capacity_calibration_with_explicit_transformer_tap_settings_no_generator_config(httpserver: HTTPServer):
811+
def test_run_hosting_capacity_calibration_with_explicit_transformer_tap_settings_no_generator_config(
812+
httpserver: HTTPServer):
811813
eas_client = EasClient(
812814
LOCALHOST,
813815
httpserver.port,
@@ -901,14 +903,15 @@ def hosting_capacity_run_calibration_with_generator_config_request_handler(reque
901903
'normVMinPu': None,
902904
'stepSizeMinutes': None,
903905
'voltageBases': None
904-
}
905906
}
906907
}
908+
}
907909

908910
return Response(json.dumps({"result": "success"}), status=200, content_type="application/json")
909911

910912

911-
def test_run_hosting_capacity_calibration_with_explicit_transformer_tap_settings_partial_generator_config(httpserver: HTTPServer):
913+
def test_run_hosting_capacity_calibration_with_explicit_transformer_tap_settings_partial_generator_config(
914+
httpserver: HTTPServer):
912915
eas_client = EasClient(
913916
LOCALHOST,
914917
httpserver.port,
@@ -921,7 +924,8 @@ def test_run_hosting_capacity_calibration_with_explicit_transformer_tap_settings
921924
datetime(1902, month=1, day=28, hour=0, minute=0, second=20),
922925
["one", "two"],
923926
transformer_tap_settings="test_tap_settings",
924-
generator_config=GeneratorConfig(solve=SolveConfig(norm_vmax_pu=23.9))
927+
generator_config=GeneratorConfig(
928+
solve=SolveConfig(norm_vmax_pu=23.9))
925929
)
926930
httpserver.check_assertions()
927931
assert res == {"result": "success"}
@@ -989,17 +993,18 @@ def hosting_capacity_run_calibration_with_partial_model_config_request_handler(r
989993
'swerVoltageToLineVoltage': None,
990994
'transformerTapSettings': 'test_tap_settings',
991995
'vmPu': 123.4
992-
},
996+
},
993997
'nodeLevelResults': None,
994998
'rawResults': None,
995999
'solve': None
996-
}
1000+
}
9971001
}
9981002

9991003
return Response(json.dumps({"result": "success"}), status=200, content_type="application/json")
10001004

10011005

1002-
def test_run_hosting_capacity_calibration_with_explicit_transformer_tap_settings_partial_model_config(httpserver: HTTPServer):
1006+
def test_run_hosting_capacity_calibration_with_explicit_transformer_tap_settings_partial_model_config(
1007+
httpserver: HTTPServer):
10031008
eas_client = EasClient(
10041009
LOCALHOST,
10051010
httpserver.port,
@@ -1292,7 +1297,7 @@ def run_opendss_export_request_handler(request):
12921297
simplify_plsi_threshold=20.0,
12931298
emerg_amp_scaling=1.8,
12941299
inverter_control_config=PVVoltVARVoltWattConfig(
1295-
cut_off_date=datetime(2024, 4, 12, 11, 42),
1300+
cut_off_date=datetime(2024, 4, 12, 11, 42),
12961301
before_cut_off_profile="beforeProfile",
12971302
after_cut_off_profile="afterProfile"
12981303
)
@@ -1366,7 +1371,8 @@ def test_run_opendss_export_valid_certificate_success(ca: trustme.CA, httpserver
13661371
ca_filename=ca_filename
13671372
)
13681373

1369-
OPENDSS_CONFIG.load_time = FixedTime(datetime(2022, 4, 1), {"meter1": FixedTimeLoadOverride([1.0], [2.0], [3.0], [4.0])})
1374+
OPENDSS_CONFIG.load_time = FixedTime(datetime(2022, 4, 1),
1375+
{"meter1": FixedTimeLoadOverride([1.0], [2.0], [3.0], [4.0])})
13701376
httpserver.expect_oneshot_request("/api/graphql").respond_with_handler(run_opendss_export_request_handler)
13711377
res = eas_client.run_opendss_export(OPENDSS_CONFIG)
13721378
httpserver.check_assertions()
@@ -1387,134 +1393,7 @@ def test_run_opendss_export_valid_certificate_success(ca: trustme.CA, httpserver
13871393
downloadUrl
13881394
isPublic
13891395
errors
1390-
generationSpec {
1391-
modelOptions{
1392-
scenario
1393-
year
1394-
feeder
1395-
}
1396-
modulesConfiguration {
1397-
common {
1398-
fixedTime{
1399-
loadTime
1400-
overrides {
1401-
loadId
1402-
loadWattsOverride
1403-
genWattsOverride
1404-
loadVarOverride
1405-
genVarOverride
1406-
}
1407-
}
1408-
timePeriod {
1409-
startTime
1410-
endTime
1411-
overrides {
1412-
loadId
1413-
loadWattsOverride
1414-
genWattsOverride
1415-
loadVarOverride
1416-
genVarOverride
1417-
}
1418-
}
1419-
}
1420-
generator {
1421-
model {
1422-
vmPu
1423-
loadVMinPu
1424-
loadVMaxPu
1425-
genVMinPu
1426-
genVMaxPu
1427-
loadModel
1428-
collapseSWER
1429-
calibration
1430-
pFactorBaseExports
1431-
pFactorForecastPv
1432-
pFactorBaseImports
1433-
fixSinglePhaseLoads
1434-
maxSinglePhaseLoad
1435-
fixOverloadingConsumers
1436-
maxLoadTxRatio
1437-
maxGenTxRatio
1438-
fixUndersizedServiceLines
1439-
maxLoadServiceLineRatio
1440-
maxLoadLvLineRatio
1441-
simplifyNetwork
1442-
collapseLvNetworks
1443-
collapseNegligibleImpedances
1444-
combineCommonImpedances
1445-
feederScenarioAllocationStrategy
1446-
closedLoopVRegEnabled
1447-
closedLoopVRegReplaceAll
1448-
closedLoopVRegSetPoint
1449-
closedLoopVBand
1450-
closedLoopTimeDelay
1451-
closedLoopVLimit
1452-
defaultTapChangerTimeDelay
1453-
defaultTapChangerSetPointPu
1454-
defaultTapChangerBand
1455-
splitPhaseDefaultLoadLossPercentage
1456-
splitPhaseLVKV
1457-
swerVoltageToLineVoltage
1458-
loadPlacement
1459-
loadIntervalLengthHours
1460-
meterPlacementConfig {
1461-
feederHead
1462-
distTransformers
1463-
switchMeterPlacementConfigs {
1464-
meterSwitchClass
1465-
namePattern
1466-
}
1467-
energyConsumerMeterGroup
1468-
}
1469-
seed
1470-
defaultLoadWatts
1471-
defaultGenWatts
1472-
defaultLoadVar
1473-
defaultGenVar
1474-
transformerTapSettings
1475-
ctPrimScalingFactor
1476-
useSpanLevelThreshold
1477-
ratingThreshold
1478-
simplifyPLSIThreshold
1479-
emergAmpScaling
1480-
inverterControlConfig {
1481-
cutOffDate
1482-
beforeCutOffProfile
1483-
afterCutOffProfile
1484-
}
1485-
}
1486-
solve {
1487-
normVMinPu
1488-
normVMaxPu
1489-
emergVMinPu
1490-
emergVMaxPu
1491-
baseFrequency
1492-
voltageBases
1493-
maxIter
1494-
maxControlIter
1495-
mode
1496-
stepSizeMinutes
1497-
}
1498-
rawResults {
1499-
energyMeterVoltagesRaw
1500-
energyMetersRaw
1501-
resultsPerMeter
1502-
overloadsRaw
1503-
voltageExceptionsRaw
1504-
}
1505-
nodeLevelResults {
1506-
collectVoltage
1507-
collectCurrent
1508-
collectPower
1509-
mridsToCollect
1510-
collectAllSwitches
1511-
collectAllTransformers
1512-
collectAllConductors
1513-
collectAllEnergyConsumers
1514-
}
1515-
}
1516-
}
1517-
}
1396+
generationSpec
15181397
}
15191398
}
15201399
}
@@ -1783,7 +1662,8 @@ def test_get_ingestor_run_list_all_filters_no_verify_success(httpserver: HTTPSer
17831662
verify_certificate=False
17841663
)
17851664

1786-
httpserver.expect_oneshot_request("/api/graphql").respond_with_handler(get_ingestor_run_list_request_complete_handler)
1665+
httpserver.expect_oneshot_request("/api/graphql").respond_with_handler(
1666+
get_ingestor_run_list_request_complete_handler)
17871667
res = eas_client.get_ingestor_run_list(
17881668
query_filter=IngestorRunsFilterInput(
17891669
id=4,

0 commit comments

Comments
 (0)