@pytest.mark.parametrize('data_file,gold_standard_file,output_format,language', [('data/examples/wit/demo-flights.json', 'data/test/wit_converted_to_rasa.json', 'json', None), ('data/examples/luis/demo-restaurants.json', 'data/test/luis_converted_to_rasa.json', 'json', None), ('data/examples/dialogflow/', 'data/test/dialogflow_en_converted_to_rasa.json', 'json', 'en'), ('data/examples/dialogflow/', 'data/test/dialogflow_es_converted_to_rasa.json', 'json', 'es'), ('data/examples/rasa/demo-rasa.md', 'data/test/md_converted_to_json.json', 'json', None), ('data/examples/rasa/demo-rasa.json', 'data/test/json_converted_to_md.md', 'md', None), ('data/test/training_data_containing_special_chars.json', 'data/test/json_with_special_chars_convered_to_md.md', 'md', None)])
def test_training_data_conversion(tmpdir, data_file, gold_standard_file, output_format, language):
    out_path = tmpdir.join('rasa_nlu_data.json')
    convert_training_data(data_file, out_path.strpath, output_format, language)
    td = training_data.load_data(out_path.strpath, language)
    assert (td.entity_examples != [])
    assert (td.intent_examples != [])
    gold_standard = training_data.load_data(gold_standard_file, language)
    cmp_message_list(td.entity_examples, gold_standard.entity_examples)
    cmp_message_list(td.intent_examples, gold_standard.intent_examples)
    assert (td.entity_synonyms == gold_standard.entity_synonyms)
    rto_path = tmpdir.join('data_in_original_format.txt')
    convert_training_data(out_path.strpath, rto_path.strpath, 'json', language)
    rto = training_data.load_data(rto_path.strpath, language)
    cmp_message_list(gold_standard.entity_examples, rto.entity_examples)
    cmp_message_list(gold_standard.intent_examples, rto.intent_examples)
    assert (gold_standard.entity_synonyms == rto.entity_synonyms)
@pytest.mark.parametrize('data_file,gold_standard_file,output_format,language', [('data/examples/wit/demo-flights.json', 'data/test/wit_converted_to_rasa.json', 'json', None), ('data/examples/luis/demo-restaurants.json', 'data/test/luis_converted_to_rasa.json', 'json', None), ('data/examples/dialogflow/', 'data/test/dialogflow_en_converted_to_rasa.json', 'json', 'en'), ('data/examples/dialogflow/', 'data/test/dialogflow_es_converted_to_rasa.json', 'json', 'es'), ('data/examples/rasa/demo-rasa.md', 'data/test/md_converted_to_json.json', 'json', None), ('data/examples/rasa/demo-rasa.json', 'data/test/json_converted_to_md.md', 'md', None), ('data/test/training_data_containing_special_chars.json', 'data/test/json_with_special_chars_convered_to_md.md', 'md', None)])
def test_training_data_conversion(tmpdir, data_file, gold_standard_file, output_format, language):
    out_path = tmpdir.join('rasa_nlu_data.json')
    convert_training_data(data_file, out_path.strpath, output_format, language)
    td = training_data.load_data(out_path.strpath, language)
    assert (td.entity_examples != [])
    assert (td.intent_examples != [])
    gold_standard = training_data.load_data(gold_standard_file, language)
    cmp_message_list(td.entity_examples, gold_standard.entity_examples)
    cmp_message_list(td.intent_examples, gold_standard.intent_examples)
    assert (td.entity_synonyms == gold_standard.entity_synonyms)
    rto_path = tmpdir.join('data_in_original_format.txt')
    convert_training_data(out_path.strpath, rto_path.strpath, 'json', language)
    rto = training_data.load_data(rto_path.strpath, language)
    cmp_message_list(gold_standard.entity_examples, rto.entity_examples)
    cmp_message_list(gold_standard.intent_examples, rto.intent_examples)
    assert (gold_standard.entity_synonyms == rto.entity_synonyms)