File: test_dump.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 (21 lines) | stat: -rw-r--r-- 452 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""
Test dump, dumps, load and loads

These are thin wrappers around AsdfFile
so the tests here will be relatively simple.
"""

from asdf import dump, dumps, load, loads
from asdf._tests._helpers import assert_tree_match


def test_roundtrip(tmp_path, tree):
    fn = tmp_path / "test.asdf"
    dump(tree, fn)
    rt = load(fn)
    assert_tree_match(tree, rt)


def test_str_roundtrip(tree):
    rt = loads(dumps(tree))
    assert_tree_match(tree, rt)