def test_tag_is_completed(self): # Test tag with isCompleted set to True self.assertTrue(Tag.from_json({ "targetType": 0, "target": "Test", "action": Tag.Action.ASSIGN, "location": 0, "isCompleted": True }).is_completed)
def test_tag_parsing_type_validation(self): # Test valid JSON self.assertIsInstance(Tag.from_json({ "targetType": 0, "target": "Test", "action": Tag.Action.ASSIGN, "location": 0 }), Tag) # Test tag targetType property type validation self.assertRaises(InvalidJSONException, Tag.from_json, { "targetType": "", "target": "Test", "action": Tag.Action.ASSIGN, "location": 0 }) # Test tag target type validation self.assertRaises(InvalidJSONException, Tag.from_json, { "targetType": 0, "target": 0, "action": Tag.Action.ASSIGN, "location": 0 }) # Test tag value type validation self.assertRaises(InvalidJSONException, Tag.from_json, { "targetType": 0, "target": "Test", "action": 0, "location": 0 }) # Test tag location type validation self.assertRaises(InvalidJSONException, Tag.from_json, { "targetType": 0, "target": "Test", "action": Tag.Action.ASSIGN, "location": "" })