Completed
Push — master ( b89757...67321d )
by Satoru
01:13
created

Test_00_Functions.test_10_query()   A

Complexity

Conditions 3

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
1
#
2
# Copyright (C) 2017 Satoru SATOH <ssato at redhat.com>
3
# License: MIT
4
#
5
# pylint: disable=missing-docstring, invalid-name
6
from __future__ import absolute_import
7
8
import unittest
9
import anyconfig.query as TT
10
11
# from tests.common import dicts_equal
12
13
14
class Test_00_Functions(unittest.TestCase):
15
16
    def test_10_query(self):
17
        try:
18
            if TT.jmespath:
19
                self.assertEquals(TT.query({"a": 1}, ac_query="a"), 1)
20
                self.assertEquals(TT.query({"a": {"b": 2}}, ac_query="a.b"),
21
                                  2)
22
        except (NameError, AttributeError):
23
            pass
24
25
# vim:sw=4:ts=4:et:
26