예제 #1
0
    def test_finish_matcher(self):

        options_dict_b =  {
            u"configuration": u"straight-tops",
            u"material-choices": {
                u"default": u"standard-laminate",
                u"name": u"Material",
                u"type": u"set::string",
                u"values": {
                    u"name": u"Standard Laminate",
                    u"options": {
                        u"finish": u"$ref:/finishes/opendesk/standard-laminate"
                    },
                    u"type": u"string",
                    u"value": u"standard-laminate"
                }
            }
        }

        b_matcher = KeyMatcher.from_dict(options_dict_b)

        self.assertEqual(b_matcher.options["material-choices/finish"], "$ref:/finishes/opendesk/standard-laminate")
예제 #2
0
    def test_finish_matcher(self):

        options_dict_b = {
            u"configuration": u"straight-tops",
            u"material-choices": {
                u"default": u"standard-laminate",
                u"name": u"Material",
                u"type": u"set::string",
                u"values": {
                    u"name": u"Standard Laminate",
                    u"options": {
                        u"finish": u"$ref:/finishes/opendesk/standard-laminate"
                    },
                    u"type": u"string",
                    u"value": u"standard-laminate"
                }
            }
        }

        b_matcher = KeyMatcher.from_dict(options_dict_b)

        self.assertEqual(b_matcher.options["material-choices/finish"],
                         "$ref:/finishes/opendesk/standard-laminate")
예제 #3
0
 def __init__(self, d):
     """
     really its just a wrapped around an existing dict
     """
     self.store = d
     self.matcher = KeyMatcher.from_dict(d)
예제 #4
0
파일: options.py 프로젝트: opendesk/winnow
 def __init__(self, d):
     """
     really its just a wrapped around an existing dict
     """
     self.store = d
     self.matcher = KeyMatcher.from_dict(d)