Beispiel #1
0
def test_is_not_nlu_file_with_json():
    directory = tempfile.mkdtemp()
    file = os.path.join(directory, "test.json")
    with open(file, "w") as f:
        f.write('{"test": "a"}')

    assert not data._is_nlu_file(file)
Beispiel #2
0
def test_is_nlu_file_with_json():
    test = {"rasa_nlu_data": {"lookup_tables": [
        {"name": "plates", "elements": ["beans", "rice", "tacos", "cheese"]}]}}

    directory = tempfile.mkdtemp()
    file = os.path.join(directory, "test.json")
    with open(file, "w") as f:
        f.write(json.dumps(test))

    assert data._is_nlu_file(file)