Skip to content

Commit

Permalink
use constant for training data version everywhere (#10909)
Browse files Browse the repository at this point in the history
* rebase

* fix import of constant name

* fix quoting

* Always use DoubleQuotedScalarString for training data version

* Add another case of DoubleQuotedScalarString

* missing fstrings
  • Loading branch information
indam23 authored Feb 22, 2022
1 parent 36aab9a commit a7a0a73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions test_rasa_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from _pytest.monkeypatch import MonkeyPatch
from _pytest.pytester import RunResult
from rasa.cli import data
from rasa.shared.constants import LATEST_TRAINING_DATA_FORMAT_VERSION
from rasa.shared.importers.importer import TrainingDataImporter
from rasa.validator import Validator
import rasa.shared.utils.io
Expand Down Expand Up @@ -156,7 +157,7 @@ def test_validate_files_action_not_found_invalid_domain(
file_name = tmp_path / f"{file_type}.yml"
file_name.write_text(
f"""
version: "3.0"
version: "{LATEST_TRAINING_DATA_FORMAT_VERSION}"
{file_type}:
- {data_type}: test path
steps:
Expand All @@ -183,7 +184,7 @@ def test_validate_files_form_not_found_invalid_domain(
file_name = tmp_path / f"{file_type}.yml"
file_name.write_text(
f"""
version: "3.0"
version: "{LATEST_TRAINING_DATA_FORMAT_VERSION}"
{file_type}:
- {data_type}: test path
steps:
Expand Down Expand Up @@ -229,8 +230,8 @@ def test_validate_files_with_active_loop_null(tmp_path: Path):
def test_validate_files_form_slots_not_matching(tmp_path: Path):
domain_file_name = tmp_path / "domain.yml"
domain_file_name.write_text(
"""
version: "3.0"
f"""
version: "{LATEST_TRAINING_DATA_FORMAT_VERSION}"
forms:
name_form:
required_slots:
Expand Down Expand Up @@ -290,7 +291,7 @@ def test_validate_files_invalid_slot_mappings(tmp_path: Path):
slot_name = "started_booking_form"
domain.write_text(
f"""
version: "3.0"
version: "{LATEST_TRAINING_DATA_FORMAT_VERSION}"
intents:
- activate_booking
entities:
Expand Down
2 changes: 1 addition & 1 deletion test_rasa_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_test_core_warnings(run_in_simple_project_with_model: Callable[..., RunR
)

simple_test_story_yaml = """
version: "3.0"
version: "{LATEST_TRAINING_DATA_FORMAT_VERSION}"
stories:
- story: unlikely path
steps:
Expand Down

0 comments on commit a7a0a73

Please sign in to comment.