def test_slot_copy_copies_value_type_and_attributes(self): slot = Slot(self.to_value, self.attributes, self.fact) copy = slot.copy() self.assertEqual(slot.value, copy.value) self.assertEqual(slot.slot_type, copy.slot_type) self.assertEqual(slot.attributes, copy.attributes)
def test_slot_copy_changes_to_copy_do_not_reflect_to_original(self): slot = Slot(self.to_value, self.attributes, self.fact) copy = slot.copy() copy.attributes["new_key"] = "new_val" copy.value = LiteralSource("new literal") self.assertNotEqual(slot.value, copy.value) self.assertNotEqual(slot.attributes, copy.attributes)
def test_slot_copy_does_not_copy_fact(self): slot = Slot(self.to_value, self.attributes, self.fact) copy = slot.copy() self.assertIsNone(copy.fact)