(self)
| 285 | ) |
| 286 | |
| 287 | def test_bidirectional(self): |
| 288 | place_input, transition, Transition, Place, place, place_output = ( |
| 289 | self.tables.place_input, |
| 290 | self.tables.transition, |
| 291 | self.classes.Transition, |
| 292 | self.classes.Place, |
| 293 | self.tables.place, |
| 294 | self.tables.place_output, |
| 295 | ) |
| 296 | |
| 297 | self.mapper_registry.map_imperatively(Place, place) |
| 298 | self.mapper_registry.map_imperatively( |
| 299 | Transition, |
| 300 | transition, |
| 301 | properties=dict( |
| 302 | inputs=relationship( |
| 303 | Place, |
| 304 | place_output, |
| 305 | backref=backref( |
| 306 | "inputs", order_by=transition.c.transition_id |
| 307 | ), |
| 308 | order_by=Place.place_id, |
| 309 | ), |
| 310 | outputs=relationship( |
| 311 | Place, |
| 312 | place_input, |
| 313 | backref=backref( |
| 314 | "outputs", order_by=transition.c.transition_id |
| 315 | ), |
| 316 | order_by=Place.place_id, |
| 317 | ), |
| 318 | ), |
| 319 | ) |
| 320 | |
| 321 | t1 = Transition("transition1") |
| 322 | t2 = Transition("transition2") |
| 323 | t3 = Transition("transition3") |
| 324 | p1 = Place("place1") |
| 325 | p2 = Place("place2") |
| 326 | p3 = Place("place3") |
| 327 | |
| 328 | sess = fixture_session() |
| 329 | sess.add_all([p3, p1, t1, t2, p2, t3]) |
| 330 | |
| 331 | t1.inputs.append(p1) |
| 332 | t1.inputs.append(p2) |
| 333 | t1.outputs.append(p3) |
| 334 | t2.inputs.append(p1) |
| 335 | p2.inputs.append(t2) |
| 336 | p3.inputs.append(t2) |
| 337 | p1.outputs.append(t1) |
| 338 | sess.commit() |
| 339 | |
| 340 | self.assert_result( |
| 341 | [t1], |
| 342 | Transition, |
| 343 | {"outputs": (Place, [{"name": "place3"}, {"name": "place1"}])}, |
| 344 | ) |
nothing calls this directly
no test coverage detected