def test__payload__with_hierarchies(self): test_hierarchy_id = [["0", "*"], ["1", "*"]] test_hierarchy_name = [["Viktor", "NAME"], ["Jerry", "NAME"]] dataset = Dataset(self.test_data) dataset._set_attribute_type("id", AttributeType.QUASIIDENTIFYING) dataset._set_attribute_type("name", AttributeType.QUASIIDENTIFYING) dataset.set_hierarchies({ "id": test_hierarchy_id, "name": test_hierarchy_name }) payload = dataset._payload() self.assertEqual(test_hierarchy_id, payload["attributes"][0]["hierarchy"]) self.assertEqual(test_hierarchy_name, payload["attributes"][1]["hierarchy"])
def test__payload(self): dataset = Dataset(self.test_data) payload = dataset._payload() self.assertEqual(AttributeType.QUASIIDENTIFYING.value, payload["attributes"][0]["attributeTypeModel"]) self.assertEqual(None, payload["attributes"][0]["hierarchy"])