()
| 240 | |
| 241 | |
| 242 | def test_bin_import_export(): |
| 243 | |
| 244 | b = box(1, 1, 1) |
| 245 | |
| 246 | from io import BytesIO |
| 247 | |
| 248 | bio = BytesIO() |
| 249 | |
| 250 | b.exportBin(bio) |
| 251 | bio.seek(0) |
| 252 | |
| 253 | r = Shape.importBin(bio) |
| 254 | |
| 255 | assert r.isValid() |
| 256 | assert r.Volume() == approx(1) |
| 257 | |
| 258 | with raises(Exception): |
| 259 | Shape.importBin(BytesIO()) |
| 260 | |
| 261 | |
| 262 | def test_sample(): |