Skip to content

Commit

Permalink
[CC] Updating tests values
Browse files Browse the repository at this point in the history
  • Loading branch information
BonneelP committed Jan 3, 2023
1 parent 5b60ffb commit bda513c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
11 changes: 8 additions & 3 deletions Tests/GUI/DMachineSetup/test_SPreview.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@
("Stator phase number", "3"),
("Stator winding resistance", "0.02392 Ohm"),
("Machine total mass", "342.8 kg"),
("Stator lamination mass", "143.6 kg"),
("Stator winding mass", "59.06 kg"),
("Rotor lamination mass", "97.54 kg"),
("Rotor winding mass", "21.12 kg"),
],
"Nrow": 9,
"Nrow": 12,
}
IPMSM_dict = {
"file_path": join(machine_path, "Toyota_Prius.json").replace("\\", "/"),
Expand All @@ -42,14 +45,16 @@
("Stator phase number", "3"),
("Stator winding resistance", "0.03595 Ohm"),
("Machine total mass", "33.38 kg"),
("Stator lamination mass", "15.78 kg"),
("Stator winding mass", "4.001 kg"),
("Rotor lamination mass", "5.006 kg"),
("Rotor magnet mass", "1.236 kg"),
],
"Nrow": 9,
"Nrow": 11,
}
load_preview_test = [SCIM_dict, IPMSM_dict]


# python -m pytest ./Tests/GUI/DMachineSetup/test_SPreview.py
class TestSPreview(object):
def setup_method(self):
"""Setup the workspace and the GUI"""
Expand Down
30 changes: 22 additions & 8 deletions Tests/Methods/Machine/test_desc_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_desc_SCIM():
"""Check that the description of a SCIM is correct"""
Railway_Traction = load(join(DATA_DIR, "Machine", "Railway_Traction.json"))
desc_dict = Railway_Traction.comp_desc_dict()
assert len(desc_dict) == 9
assert len(desc_dict) == 12
assert desc_dict[0]["name"] == "Type"
assert desc_dict[0]["value"] == "SCIM"

Expand All @@ -39,16 +39,24 @@ def test_desc_SCIM():
assert desc_dict[7]["name"] == "Mmachine"
assert desc_dict[7]["value"] == pytest.approx(342.819, rel=0.1)

assert desc_dict[8]["name"] == "Mwind"
assert desc_dict[8]["value"] == pytest.approx(59.055, rel=0.1)
assert desc_dict[8]["name"] == "Mslam"
assert desc_dict[8]["value"] == pytest.approx(143.598, rel=0.1)

assert desc_dict[9]["name"] == "Mswind"
assert desc_dict[9]["value"] == pytest.approx(59.055, rel=0.1)

assert desc_dict[10]["name"] == "Mrlam"
assert desc_dict[10]["value"] == pytest.approx(97.5362, rel=0.1)

assert desc_dict[11]["name"] == "Mrwind"
assert desc_dict[11]["value"] == pytest.approx(21.118, rel=0.1)

@pytest.mark.IPMSM
def test_desc_IPMSM():
"""Check that the description of an IPMSM is correct"""
Toyota_Prius = load(join(DATA_DIR, "Machine", "Toyota_Prius.json"))
desc_dict = Toyota_Prius.comp_desc_dict()
assert len(desc_dict) == 9
assert len(desc_dict) == 11
assert desc_dict[0]["name"] == "Type"
assert desc_dict[0]["value"] == "IPMSM"

Expand All @@ -70,11 +78,17 @@ def test_desc_IPMSM():
assert desc_dict[6]["name"] == "Mmachine"
assert desc_dict[6]["value"] == pytest.approx(33.37, rel=0.1)

assert desc_dict[7]["name"] == "Mwind"
assert desc_dict[7]["value"] == pytest.approx(4.0014, rel=0.1)
assert desc_dict[7]["name"] == "Mslam"
assert desc_dict[7]["value"] == pytest.approx(15.78146, rel=0.1)

assert desc_dict[8]["name"] == "Mswind"
assert desc_dict[8]["value"] == pytest.approx(4.0014, rel=0.1)

assert desc_dict[9]["name"] == "Mrlam"
assert desc_dict[9]["value"] == pytest.approx(5.0063, rel=0.1)

assert desc_dict[8]["name"] == "Mmag"
assert desc_dict[8]["value"] == pytest.approx(1.235, rel=0.1)
assert desc_dict[10]["name"] == "Mmag"
assert desc_dict[10]["value"] == pytest.approx(1.235, rel=0.1)


@pytest.mark.outer_rotor
Expand Down

0 comments on commit bda513c

Please sign in to comment.