File: test_1553.py

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

import asdf


def test_asdf_info_should_not_load_arrays(tmp_path):
    """
    AsdfFile.info should not load array data

    https://github.com/asdf-format/asdf/issues/1553
    """
    fn = tmp_path / "test.asdf"
    tree = dict([(k, np.arange(ord(k))) for k in "abc"])
    asdf.AsdfFile(tree).write_to(fn)

    with asdf.open(fn) as af:
        assert "unloaded" in str(af["b"])
        af.info()
        assert "unloaded" in str(af["b"])