File: test_print_path_list.py

package info (click to toggle)
graphql-core 3.2.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,384 kB
  • sloc: python: 45,812; makefile: 26; sh: 13
file content (14 lines) | stat: -rw-r--r-- 426 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from graphql.pyutils import print_path_list


def describe_print_path_as_list():
    def without_key():
        assert print_path_list([]) == ""

    def with_one_key():
        assert print_path_list(["one"]) == ".one"
        assert print_path_list([1]) == "[1]"

    def with_three_keys():
        assert print_path_list([0, "one", 2]) == "[0].one[2]"
        assert print_path_list(["one", 2, "three"]) == ".one[2].three"