Exemplo n.º 1
0
    def test_nested_key_matcher(self):

        matcher = KeyMatcher()
        matcher.add_options(NESTED_OPTIONS, "piggy")
        self.assertEqual(matcher.options.keys(), [u'piggy/paint_coats', u'piggy'])

        self.assertEqual(matcher.get(u'piggy/paint_coats'), {
                            u"type": VALUE_TYPE_NUMERIC_STEP,
                            u"max": Decimal(6),
                            u"min": Decimal(1),
                            u"start": Decimal(1),
                            u"step": Decimal(1),
                        })
Exemplo n.º 2
0
    def test_nested_key_matcher(self):

        matcher = KeyMatcher()
        matcher.add_options(NESTED_OPTIONS, "piggy")
        self.assertEqual(matcher.options.keys(),
                         [u'piggy/paint_coats', u'piggy'])

        self.assertEqual(
            matcher.get(u'piggy/paint_coats'), {
                u"type": VALUE_TYPE_NUMERIC_STEP,
                u"max": Decimal(6),
                u"min": Decimal(1),
                u"start": Decimal(1),
                u"step": Decimal(1),
            })
Exemplo n.º 3
0
 def test_key_matcher_get_7(self):
     matcher = KeyMatcher()
     matcher.set("*/paul", "test")
     self.assertEqual(matcher.get("any/thing/else/paul"), "test")
Exemplo n.º 4
0
 def test_key_matcher_get_4(self):
     matcher = KeyMatcher()
     matcher.set("*/paul", "test")
     self.assertEqual(matcher.get("paul"), "test")
Exemplo n.º 5
0
 def test_key_matcher_get_fail(self):
     matcher = KeyMatcher()
     matcher.set("paul", "test")
     self.assertEqual(matcher.get("pauls"), None)
Exemplo n.º 6
0
 def test_key_matcher_get_7(self):
     matcher = KeyMatcher()
     matcher.set("*/paul", "test")
     self.assertEqual(matcher.get("any/thing/else/paul"), "test")
Exemplo n.º 7
0
 def test_key_matcher_get_4(self):
     matcher = KeyMatcher()
     matcher.set("*/paul", "test")
     self.assertEqual(matcher.get("paul"), "test")
Exemplo n.º 8
0
 def test_key_matcher_get_fail(self):
     matcher = KeyMatcher()
     matcher.set("paul", "test")
     self.assertEqual(matcher.get("pauls"), None)