()
| 140 | |
| 141 | |
| 142 | def test_quadrilateral_relations(): |
| 143 | |
| 144 | i = Interval(4, 5, axis="y") |
| 145 | q = Quadrilateral(np.array([[2, 2], [6, 2], [6, 7], [2, 5]])) |
| 146 | r = Rectangle(3, 3, 5, 6) |
| 147 | |
| 148 | assert not q.is_in(r) |
| 149 | assert q.is_in(i, soft_margin={"top": 2, "bottom": 2}) |
| 150 | assert q.is_in(r, soft_margin={"left": 1, "top": 1, "right": 1, "bottom": 1}) |
| 151 | assert q.is_in(q) |
| 152 | |
| 153 | # convert to absolute then convert back to relative |
| 154 | assert q.condition_on(i).relative_to(i) == q |
| 155 | assert q.condition_on(r).relative_to(r) == q |
| 156 | assert q.condition_on(q).relative_to(q) == q |
| 157 | |
| 158 | # convert to relative then convert back to absolute |
| 159 | assert q.relative_to(i).condition_on(i) == q |
| 160 | assert q.relative_to(r).condition_on(r) == q |
| 161 | assert q.relative_to(q).condition_on(q) == q |
| 162 | |
| 163 | |
| 164 | def test_textblock(): |
nothing calls this directly
no test coverage detected