def test_update(self): d = Data() d.update({'a': 1}) self.assertEqual(d.a, 1) self.assertEqual(d.assigns['a'], '.update') d1 = Data() d1.b = 1 d1.use('c', 2) d.update(d1) self.assertEqual(d.b, 1) self.assertEqual(d.c, 2)
def test_parse(self): d = Data() d.use('a', 0.0) d.parse('a', '1.0') self.assertEqual(d.a, 1.0) self.assertEqual(type(d.a), float)
def test_clear(self): d = Data() d.use('a', 1) d.a = 2 d.clear('a') self.assertEqual(d.a, 1)
def test_use(self): d = Data() d.use('a', 1) self.assertEqual(d.defaults['a'], 1)