File: test_dict.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 (43 lines) | stat: -rw-r--r-- 774 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
32
33
34
35
36
37
38
39
40
41
42
43
from inline_snapshot import snapshot
from inline_snapshot.testing import Example


def test_dict_var():

    Example(
        """\
from inline_snapshot import snapshot,Is

def test_list():
    l={1:2}
    assert l == snapshot(l), "not equal"
"""
    ).run_inline(
        ["--inline-snapshot=update"],
        changed_files=snapshot(
            {
                "test_something.py": """\
from inline_snapshot import snapshot,Is

def test_list():
    l={1:2}
    assert l == snapshot({1: 2}), "not equal"
"""
            }
        ),
    )


def test_dict_constructor():

    Example(
        """\
from inline_snapshot import snapshot

def test_dict():
    snapshot(dict())
"""
    ).run_inline(
        ["--inline-snapshot=fix"],
        changed_files=snapshot({}),
    )