(self)
| 101 | asyncio.run(self.run_test(2222, self.sanity_check)) |
| 102 | |
| 103 | def test_input_socket(self): |
| 104 | # First, extract the time step from the script file |
| 105 | tree = et.parse(self.script_path) |
| 106 | dt = float(tree.getroot().find("run").attrib["dt"]) |
| 107 | |
| 108 | # The aircraft c172x does not contain an <input> tag so we need |
| 109 | # to add one. |
| 110 | tree, aircraft_name, _ = CopyAircraftDef(self.script_path, self.sandbox) |
| 111 | root = tree.getroot() |
| 112 | input_tag = et.SubElement(root, "input") |
| 113 | input_tag.attrib["port"] = "1137" |
| 114 | tree.write(self.sandbox("aircraft", aircraft_name, aircraft_name + ".xml")) |
| 115 | |
| 116 | self._fdm.set_aircraft_path("aircraft") |
| 117 | self._fdm.load_script(self.script_path) |
| 118 | self._fdm.run_ic() |
| 119 | self._fdm.hold() |
| 120 | |
| 121 | asyncio.run(self.run_test(1137, lambda r, w: self.shell(root, dt, r, w))) |
| 122 | |
| 123 | async def shell(self, root, dt, reader, writer): |
| 124 | await self.sanity_check(reader, writer) |
nothing calls this directly
no test coverage detected