Spaces:
Configuration error
Configuration error
File size: 1,028 Bytes
a9f04e7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | from pcswmm_ai import PCSWMMClient
class FakeCollection(dict):
@property
def Count(self):
return len(self)
@property
def Keys(self):
return list(self.keys())
class FakeSWMM:
ProjectName = "Test Project"
ProjectFolder = r"C:\Test"
FilePath = r"C:\Test\model.inp"
Version = "SWMM5.2.3"
RunStatus = "Ready"
Scenarios = FakeCollection({"Base": object()})
Nodes = FakeCollection({"N1": object()})
Links = FakeCollection({"L1": object()})
Junctions = FakeCollection({})
Conduits = FakeCollection({})
Subcatchments = FakeCollection({"S1": object()})
Storages = FakeCollection({})
Outfalls = FakeCollection({})
def run(self):
return None
class FakeGraph:
Files = []
class FakePCPY:
SWMM = FakeSWMM()
Graph = FakeGraph()
def test_project_summary():
client = PCSWMMClient(FakePCPY())
summary = client.project.summary()
assert summary["project_name"] == "Test Project"
assert summary["node_count"] == 1
|