File: test_1538.py

package info (click to toggle)
python-asdf 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,032 kB
  • sloc: python: 24,068; makefile: 123
file content (18 lines) | stat: -rw-r--r-- 424 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import numpy as np

import asdf


def test_unable_to_read_empty_inline_array(tmp_path):
    """
    ASDF unable to read empty inline array

    https://github.com/asdf-format/asdf/issues/1538
    """
    fn = tmp_path / "test.asdf"
    a = np.array([])
    af = asdf.AsdfFile({"a": a})
    af.set_array_storage(a, "inline")
    af.write_to(fn)
    with asdf.open(fn) as af:
        np.testing.assert_array_equal(af["a"], a)