示例#1
0
 def __missing__(self, key) -> Slot:
     value = self[key] = Slot(key)
     return value
示例#2
0
文件: test_slots.py 项目: attgua/Geco
 def test_has_a_type_name(self):
     slot = self.create_slot(influence_conversation=True)
     assert slot.type_name is not None
     assert type(slot) == Slot.resolve_by_type(slot.type_name)
示例#3
0
 def __missing__(self, key: Text) -> Slot:
     value = self[key] = Slot(key, mappings=[])
     return value
示例#4
0
文件: test_slots.py 项目: attgua/Geco
def test_raises_on_invalid_slot_type():
    with pytest.raises(InvalidSlotTypeException):
        Slot.resolve_by_type("foobar")
示例#5
0
 def test_has_a_type_name(self):
     slot = self.create_slot()
     assert slot.type_name is not None
     assert type(slot) == Slot.resolve_by_type(slot.type_name)