File: test_is_normalized.py

package info (click to toggle)
python-inline-snapshot 0.23.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,116 kB
  • sloc: python: 6,888; makefile: 34; sh: 28
file content (31 lines) | stat: -rw-r--r-- 755 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
22
23
24
25
26
27
28
29
30
31
from inline_snapshot import snapshot
from inline_snapshot.testing._example import Example


def test_repr():
    Example(
        """\
from inline_snapshot import snapshot
from tests._is_normalized import IsNormalized

def test_a():
    n=IsNormalized(sorted,snapshot())
    assert [3,5,2] == n
    assert repr(n)==snapshot()
"""
    ).run_inline(
        ["--inline-snapshot=create"],
        changed_files=snapshot(
            {
                "test_something.py": """\
from inline_snapshot import snapshot
from tests._is_normalized import IsNormalized

def test_a():
    n=IsNormalized(sorted,snapshot([2, 3, 5]))
    assert [3,5,2] == n
    assert repr(n)==snapshot("IsNormalized([2, 3, 5], should_be=[2, 3, 5])")
"""
            }
        ),
    )