| 34 | |
| 35 | |
| 36 | def test_errors(): |
| 37 | # empty arrays |
| 38 | with pytest.raises(NotImplementedError) as excpt: |
| 39 | da.ones([]).to_svg() |
| 40 | assert "0 dimensions" in str(excpt.value) |
| 41 | |
| 42 | # Scalars |
| 43 | with pytest.raises(NotImplementedError) as excpt: |
| 44 | da.asarray(1).to_svg() |
| 45 | assert "0 dimensions" in str(excpt.value) |
| 46 | |
| 47 | # 0-length dims arrays |
| 48 | with pytest.raises(NotImplementedError) as excpt: |
| 49 | da.ones(10)[:0].to_svg() |
| 50 | assert "0-length dimensions" in str(excpt.value) |
| 51 | |
| 52 | # unknown chunk sizes |
| 53 | with pytest.raises(NotImplementedError) as excpt: |
| 54 | x = da.ones(10) |
| 55 | x = x[x > 5] |
| 56 | x.to_svg() |
| 57 | assert "unknown chunk sizes" in str(excpt.value) |
| 58 | |
| 59 | |
| 60 | def test_repr_html_size_units(): |