Skip to content

Commit 00a2614

Browse files
committed
cleaning and linting
1 parent 0e0f366 commit 00a2614

File tree

4 files changed

+10
-28
lines changed

4 files changed

+10
-28
lines changed

tests/models/edx/converters/xapi/test_video.py

+5-15
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ def test_models_edx_converters_xapi_video_ui_load_video_to_video_initialized(
3232
expected xAPI statement.
3333
"""
3434
event = mock_instance(UILoadVideo)
35-
event.context.course_id = (
36-
"course-v1:a+b+c" # TODO: see why generation does not work and remove this
37-
)
35+
event.context.course_id = "course-v1:a+b+c"
3836

3937
platform_url = mock_url()
4038

@@ -93,9 +91,7 @@ def test_models_edx_converters_xapi_video_ui_play_video_to_video_played(uuid_nam
9391
xAPI statement.
9492
"""
9593
event = mock_instance(UIPlayVideo)
96-
event.context.course_id = (
97-
"course-v1:a+b+c" # TODO: see why generation does not work and remove this
98-
)
94+
event.context.course_id = "course-v1:a+b+c"
9995

10096
platform_url = mock_url()
10197

@@ -160,9 +156,7 @@ def test_models_edx_converters_xapi_video_ui_pause_video_to_video_paused(
160156
statement.
161157
"""
162158
event = mock_instance(UIPauseVideo)
163-
event.context.course_id = (
164-
"course-v1:a+b+c" # TODO: see why generation does not work and remove this
165-
)
159+
event.context.course_id = "course-v1:a+b+c"
166160

167161
platform_url = mock_url()
168162

@@ -228,9 +222,7 @@ def test_models_edx_converters_xapi_video_ui_stop_video_to_video_terminated(
228222
xAPI statement.
229223
"""
230224
event = mock_instance(UIStopVideo)
231-
event.context.course_id = (
232-
"course-v1:a+b+c" # TODO: see why generation does not work and remove this
233-
)
225+
event.context.course_id = "course-v1:a+b+c"
234226

235227
platform_url = mock_url()
236228

@@ -295,9 +287,7 @@ def test_models_edx_converters_xapi_video_ui_seek_video_to_video_seeked(uuid_nam
295287
xAPI statement.
296288
"""
297289
event = mock_instance(UISeekVideo)
298-
event.context.course_id = (
299-
"course-v1:a+b+c" # TODO: see why generation does not work and remove this
300-
)
290+
event.context.course_id = "course-v1:a+b+c"
301291

302292
platform_url = mock_url()
303293

tests/models/edx/open_response_assessment/test_events.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_models_edx_ora_get_peer_submission_event_field_with_valid_values():
2727
)
2828

2929

30-
def test_models_edx_ora_get_submission_for_staff_grading_event_field_with_valid_values():
30+
def test_models_edx_ora_get_submission_for_staff_grading_event_field_with_valid_values(): # noqa: E501
3131
"""Test that a valid `ORAGetSubmissionForStaffGradingEventField` does not raise a
3232
`ValidationError`.
3333
"""

tests/models/test_validator.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@ def test_models_validator_validate_with_an_invalid_page_close_event_writes_an_er
119119
)
120120
with caplog.at_level(logging.ERROR):
121121
assert not list(result)
122-
errors = [
123-
"Input event is not valid."
124-
]
122+
errors = ["Input event is not valid."]
125123
assert errors == [message for _, _, message in caplog.record_tuples]
126124

127125

tests/models/xapi/base/test_statements.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ def test_models_xapi_base_statement_with_invalid_null_values(path, value):
5656
"context__extensions__https://w3id.org/xapi/video",
5757
],
5858
)
59-
@pytest.mark.parametrize(
60-
"value", [None, {}]
61-
)
59+
@pytest.mark.parametrize("value", [None, {}])
6260
def test_models_xapi_base_statement_with_valid_null_values(path, value):
6361
"""Test that the statement does accept valid null values in extensions fields.
6462
@@ -363,9 +361,7 @@ def test_models_xapi_base_statement_with_invalid_group_objects(klass):
363361

364362
kwargs = {"exclude_none": True}
365363
statement = statement.model_dump(**kwargs)
366-
statement["actor"]["member"] = [
367-
mock_xapi_instance(klass).model_dump(**kwargs)
368-
]
364+
statement["actor"]["member"] = [mock_xapi_instance(klass).model_dump(**kwargs)]
369365

370366
for class_ in [
371367
"BaseXapiAgentWithMbox",
@@ -571,9 +567,7 @@ def test_models_xapi_base_statement_should_consider_valid_all_defined_xapi_model
571567
# All specific xAPI models should inherit BaseXapiStatement
572568
assert issubclass(model, BaseXapiStatement)
573569
statement = mock_xapi_instance(model)
574-
statement = statement.json(
575-
exclude_none=True, by_alias=True
576-
)
570+
statement = statement.json(exclude_none=True, by_alias=True)
577571
try:
578572
BaseXapiStatement(**json.loads(statement))
579573
except ValidationError as err:

0 commit comments

Comments
 (0)