def test_add_child_1(self): p = make_parent("test", "color") add_child(p, 'child', 'color', 0, [], 'desc') self.assertEqual(p['children'][0]['id'], 'child') self.assertEqual(p['children'][0]['data']['$color'], 'color') self.assertEqual(p['children'][0]['data']['$area'], 0) self.assertEqual(p['children'][0]['data']['popularity'], 0) self.assertEqual(p['children'][0]['data']['image'], 'None') self.assertEqual(p['children'][0]['data']['description'], 'desc')
def test_add_child_1(self): p = make_parent("test", "color") add_child(p, "child", "color", 0, [], "desc") self.assertEqual(p["children"][0]["id"], "child") self.assertEqual(p["children"][0]["data"]["$color"], "color") self.assertEqual(p["children"][0]["data"]["$area"], 0) self.assertEqual(p["children"][0]["data"]["popularity"], 0) self.assertEqual(p["children"][0]["data"]["image"], "None") self.assertEqual(p["children"][0]["data"]["description"], "desc")
def test_make_parent_3(self): p = make_parent((1, 2), [1, 2, 3]) self.assertEqual(p['id'], (1, 2)) self.assertEqual(p['data']['$color'], [1, 2, 3])
def test_make_parent_2(self): p = make_parent(1, "color") self.assertEqual(p['id'], 1) self.assertEqual(p['data']['$color'], "color")
def test_make_parent_1(self): p = make_parent("test", "color") self.assertEqual(p['id'], "test") self.assertEqual(p['data']['$color'], "color")
def test_make_parent_3(self): p = make_parent((1, 2), [1, 2, 3]) self.assertEqual(p["id"], (1, 2)) self.assertEqual(p["data"]["$color"], [1, 2, 3])
def test_make_parent_2(self): p = make_parent(1, "color") self.assertEqual(p["id"], 1) self.assertEqual(p["data"]["$color"], "color")
def test_make_parent_1(self): p = make_parent("test", "color") self.assertEqual(p["id"], "test") self.assertEqual(p["data"]["$color"], "color")