-
Notifications
You must be signed in to change notification settings - Fork 33
BDD tests for removing project in training and testing dataset #232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
# with no express or implied warranties, other than those that are expressly stated | ||
# in the License. | ||
|
||
from behave import then, when | ||
from behave import step, then, when | ||
from behave.runner import Context | ||
from geti_client import ModelsApi, TrainJob, TrainModelRequest | ||
from static_definitions import TaskType | ||
|
@@ -49,7 +49,7 @@ def _train( | |
context.job_id = train_response.job_id | ||
|
||
|
||
@when("the user requests to train a model") | ||
@step("the user requests to train a model") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Imo it's better to avoid generic I suggest to rewrite the following part of your test:
as:
It doesn't affect readability too much, while it retains a clear distinction between given/when/then steps. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I disagree, the Given keyword indicates that the step is doing something that is a prerequisite for what we want to test, the When is a keyword indicating an action that we want to test, the Then keyword indicates a sentence that tests if the expected behavior of the When action is achieved. Other than these meanings there is no real difference between these steps from a technical point of view, they are all run in the same way and should all pass in the same way. In this scenario we do not test whether or not the user requests to train a model actually starts a job that trains a model, we only need a job running to lock the project for the deletion. Therefore this step should be called with the Given keyword to indicate to the reader this step is necessary to set the system in a state that we need to check the proper behavior of the deletion of projects. One limitation of |
||
def step_when_user_trains_model(context: Context): | ||
_train(context=context) | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.