def test_domain_to_yaml():
    test_yaml = """action_factory: null
action_names:
- utter_greet
actions:
- utter_greet
config:
  store_entities_as_slots: true
entities: []
intents: []
slots: {}
templates:
  utter_greet:
  - text: hey there!"""
    domain = TemplateDomain.load_from_yaml(test_yaml)
    assert test_yaml.strip() == domain.as_yaml().strip()
    domain = TemplateDomain.load_from_yaml(domain.as_yaml())
Exemple #2
0
def test_domain_to_yaml():
    test_yaml = """action_factory: null
action_names:
- utter_greet
actions:
- utter_greet
config:
  store_entities_as_slots: true
entities: []
intents: []
slots: {}
templates:
  utter_greet:
  - text: hey there!"""
    domain = TemplateDomain.load_from_yaml(test_yaml)
    assert test_yaml.strip() == domain.as_yaml().strip()
    domain = TemplateDomain.load_from_yaml(domain.as_yaml())
Exemple #3
0
def test_domain_to_yaml():
    test_yaml = """action_factory: null
action_names:
- utter_greet
actions:
- utter_greet
config:
  store_entities_as_slots: true
entities: []
intents: []
slots: {}
templates:
  utter_greet:
  - text: hey there!"""
    domain = TemplateDomain.load_from_yaml(test_yaml)
    # python 3 and 2 are different here, python 3 will have a leading set 
    # of --- at the begining of the yml
    assert domain.as_yaml().strip().endswith(test_yaml.strip())
    domain = TemplateDomain.load_from_yaml(domain.as_yaml())
Exemple #4
0
def test_domain_to_yaml():
    test_yaml = """action_factory: null
action_names:
- utter_greet
actions:
- utter_greet
config:
  store_entities_as_slots: true
entities: []
intents: []
slots: {}
templates:
  utter_greet:
  - text: hey there!"""
    domain = TemplateDomain.load_from_yaml(test_yaml)
    # python 3 and 2 are different here, python 3 will have a leading set
    # of --- at the begining of the yml
    assert domain.as_yaml().strip().endswith(test_yaml.strip())
    domain = TemplateDomain.load_from_yaml(domain.as_yaml())