Skip to content

Commit 3679762

Browse files
committed
Get missed cases.
1 parent b5945f6 commit 3679762

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

tests/tests_integration/test_settings.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def test_persistent_settings_name_templates(self, project):
6565

6666
assert (
6767
str(e.value)
68-
== "TEMPLATE: The name: sub-3_id-abC_random-helloworld "
69-
"does not match the template: sub-\\d_id-.?.?_random-.*"
68+
== r"TEMPLATE: The name: sub-3_id-abC_random-helloworld "
69+
r"does not match the template: sub-\\d_id-.?.?_random-.*"
7070
)
7171

7272
# Good sub name (should not raise)
@@ -78,8 +78,8 @@ def test_persistent_settings_name_templates(self, project):
7878

7979
assert (
8080
str(e.value)
81-
== "TEMPLATE: The name: ses-33_id-xyz_ranDUM-helloworld "
82-
"does not match the template: ses-\\d\\d_id-.?.?.?_random-.*"
81+
== r"TEMPLATE: The name: ses-33_id-xyz_ranDUM-helloworld "
82+
r"does not match the template: ses-\\d\\d_id-.?.?.?_random-.*"
8383
)
8484

8585
# Good ses name (should not raise)

tests/tests_integration/test_validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,11 @@ def test_name_templates_validate_project(self, project):
784784
project.validate_project("rawdata", "warn", include_central=False)
785785

786786
assert (
787-
"TEMPLATE: The name: sub-02_id-a1 does not match the template: sub-\\d\\d_id-\\d.?"
787+
r"TEMPLATE: The name: sub-02_id-a1 does not match the template: sub-\\d\\d_id-\\d.?"
788788
in str(w[0].message)
789789
)
790790
assert (
791-
"TEMPLATE: The name: ses-02_id-aa does not match the template: ses-\\d\\d_id-\\d.?"
791+
r"TEMPLATE: The name: ses-02_id-aa does not match the template: ses-\\d\\d_id-\\d.?"
792792
in str(w[1].message)
793793
)
794794

tests/tests_tui/test_tui_create_folders.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ async def test_create_folders_formatted_names(self, setup_project_paths):
107107
"sub-001_@DATE@, sub-002_@DATE@",
108108
)
109109

110-
sub_1_regexp = "sub\-001_date\-\d{8}"
111-
sub_2_regexp = "sub\-002_date\-\d{8}"
110+
sub_1_regexp = r"sub\-001_date\-\d{8}"
111+
sub_2_regexp = r"sub\-002_date\-\d{8}"
112112
sub_tooltip_regexp = (
113113
"Formatted names: \['"
114114
+ sub_1_regexp
@@ -127,9 +127,9 @@ async def test_create_folders_formatted_names(self, setup_project_paths):
127127
pilot, "#create_folders_session_input", "ses-001@TO@003_@DATE@"
128128
)
129129

130-
ses_1_regexp = "ses\-001_date\-\d{8}"
131-
ses_2_regexp = "ses\-002_date\-\d{8}"
132-
ses_3_regexp = "ses\-003_date\-\d{8}"
130+
ses_1_regexp = r"ses\-001_date\-\d{8}"
131+
ses_2_regexp = r"ses\-002_date\-\d{8}"
132+
ses_3_regexp = r"ses\-003_date\-\d{8}"
133133
ses_tooltip_regexp = (
134134
"Formatted names: \['"
135135
+ ses_1_regexp
@@ -354,7 +354,7 @@ async def test_name_template_next_sub_or_ses_and_validation(
354354
# Set some name template and check the tooltips
355355
# indicate mismatches correctly
356356
pilot.app.screen.interface.project.set_name_templates(
357-
{"on": True, "sub": "sub-\d\d\d", "ses": "ses-...."}
357+
{"on": True, "sub": r"sub-\d\d\d", "ses": "ses-...."}
358358
)
359359

360360
await self.fill_input(
@@ -365,7 +365,7 @@ async def test_name_template_next_sub_or_ses_and_validation(
365365
pilot.app.screen.query_one(
366366
"#create_folders_subject_input"
367367
).tooltip
368-
== "TEMPLATE: The name: sub-0001 does not match the template: sub-\\d\\d\\d"
368+
== r"TEMPLATE: The name: sub-0001 does not match the template: sub-\\d\\d\\d"
369369
)
370370

371371
# It is expected that sub errors propagate to session input.
@@ -378,7 +378,7 @@ async def test_name_template_next_sub_or_ses_and_validation(
378378
pilot.app.screen.query_one(
379379
"#create_folders_session_input"
380380
).tooltip
381-
== "TEMPLATE: The name: sub-0001 does not match the template: sub-\\d\\d\\d"
381+
== r"TEMPLATE: The name: sub-0001 does not match the template: sub-\\d\\d\\d"
382382
)
383383

384384
# Try and make the folders, displaying a validation error.
@@ -388,7 +388,7 @@ async def test_name_template_next_sub_or_ses_and_validation(
388388
assert pilot.app.screen.query_one(
389389
"#messagebox_message_label"
390390
).renderable == (
391-
"TEMPLATE: The name: sub-0001 does not match the template: sub-\\d\\d\\d"
391+
r"TEMPLATE: The name: sub-0001 does not match the template: sub-\\d\\d\\d"
392392
)
393393

394394
await self.close_messagebox(pilot)
@@ -429,7 +429,7 @@ async def test_name_template_next_sub_or_ses_and_validation(
429429
pilot.app.screen.query_one(
430430
"#create_folders_subject_input"
431431
).value
432-
== "sub-\\d\\d\\d"
432+
== r"sub-\\d\\d\\d"
433433
)
434434

435435
await self.double_click(

tests/tests_tui/test_tui_widgets_and_defaults.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,8 @@ async def test_name_templates_widgets_and_settings(
509509
"""
510510
tmp_config_path, tmp_path, project_name = setup_project_paths.values()
511511

512-
sub_regexp = "sub-\d\d\d"
513-
ses_regexp = "ses-00\d_????"
512+
sub_regexp = r"sub-\d\d\d"
513+
ses_regexp = r"ses-00\d_????"
514514

515515
app = TuiApp()
516516
async with app.run_test(size=self.tui_size()) as pilot:

0 commit comments

Comments
 (0)