Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Fuggitti <francesco.fuggitti@gmail.com>
  • Loading branch information
francescofuggitti committed Sep 22, 2022
1 parent 855ab49 commit 46a61d9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
13 changes: 10 additions & 3 deletions tests/test_gpt3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from nl2ltl import translate
from nl2ltl.engines.gpt3.core import GPT3Engine
from nl2ltl.filters.simple_filters import BasicFilter
from nl2ltl.filters.simple_filters import BasicFilter, GreedyFilter

from .conftest import UtterancesFixtures

Expand All @@ -22,9 +22,16 @@ def setup_class(cls):
"""
cls.gpt3_engine = GPT3Engine()
cls.basic_filter = BasicFilter()
cls.greedy_filter = GreedyFilter()

@pytest.mark.parametrize("utterance", UtterancesFixtures.utterances)
def test_gpt3_engine(self, utterance):
"""Test GPT-3 engine for utterances."""
def test_gpt3_engine_basic(self, utterance):
"""Test GPT-3 engine for utterances with basic filter."""
output = translate(utterance, self.gpt3_engine, self.basic_filter)
assert isinstance(output, Dict)

@pytest.mark.parametrize("utterance", UtterancesFixtures.utterances)
def test_gpt3_engine_greedy(self, utterance):
"""Test GPT-3 engine for utterances with greedy filter."""
output = translate(utterance, self.gpt3_engine, self.greedy_filter)
assert isinstance(output, Dict)
13 changes: 10 additions & 3 deletions tests/test_rasa.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from nl2ltl import translate
from nl2ltl.engines.rasa.core import RasaEngine
from nl2ltl.filters.simple_filters import BasicFilter
from nl2ltl.filters.simple_filters import BasicFilter, GreedyFilter

from .conftest import UtterancesFixtures

Expand All @@ -22,9 +22,16 @@ def setup_class(cls):
"""
cls.rasa_engine = RasaEngine()
cls.basic_filter = BasicFilter()
cls.greedy_filter = GreedyFilter()

@pytest.mark.parametrize("utterance", UtterancesFixtures.utterances)
def test_rasa_engine(self, utterance):
"""Test Rasa engine for utterances."""
def test_rasa_engine_basic(self, utterance):
"""Test Rasa engine for utterances with basic filter."""
output = translate(utterance, self.rasa_engine, self.basic_filter)
assert isinstance(output, Dict)

@pytest.mark.parametrize("utterance", UtterancesFixtures.utterances)
def test_rasa_engine_greedy(self, utterance):
"""Test Rasa engine for utterances with greedy filter."""
output = translate(utterance, self.rasa_engine, self.greedy_filter)
assert isinstance(output, Dict)

0 comments on commit 46a61d9

Please sign in to comment.