コード例 #1
0
    def testIntWithoutAttr(self):
        attrs = {
            "something2": "5"
        }

        attr_dict = AttrDictionary(attrs)
        attr = attr_dict.float("something", 1)
        self.assertEqual(1, attr)
コード例 #2
0
    def testFloatAttr(self):
        attrs = {
            "something": "0.5"
        }

        attr_dict = AttrDictionary(attrs)
        attr = attr_dict.float("something", 0.1)
        self.assertEqual(0.5, attr)