Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
thomasDOTwtf
hub
Commits
03c3d7f4
Commit
03c3d7f4
authored
Dec 25, 2023
by
HeJ
Browse files
Options
Downloads
Patches
Plain Diff
schedule import: adjust tests to count speaker mappings, too
parent
82a685ac
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/tests/schedules.py
+5
-5
5 additions, 5 deletions
src/core/tests/schedules.py
with
5 additions
and
5 deletions
src/core/tests/schedules.py
+
5
−
5
View file @
03c3d7f4
...
@@ -310,7 +310,7 @@ class ScheduleTests(TestCase):
...
@@ -310,7 +310,7 @@ class ScheduleTests(TestCase):
import_type
=
ScheduleJSONSupport
.
identifier
,
import_type
=
ScheduleJSONSupport
.
identifier
,
import_url
=
f
"
file://
{
Path
(
__file__
).
parent
.
joinpath
(
'
import_data
'
,
'
schedule-2020.json
'
)
}
"
,
import_url
=
f
"
file://
{
Path
(
__file__
).
parent
.
joinpath
(
'
import_data
'
,
'
schedule-2020.json
'
)
}
"
,
)
)
self
.
check_json
(
src
,
rooms
=
1
,
events
=
1
,
room_name
=
'
Yellow Room
'
)
self
.
check_json
(
src
,
rooms
=
1
,
events
=
1
,
speakers
=
2
,
room_name
=
'
Yellow Room
'
,
event_id
=
'
12345
'
)
@override_settings
(
SCHEDULES_SUPPORT_FILE_PROTOCOL
=
True
)
@override_settings
(
SCHEDULES_SUPPORT_FILE_PROTOCOL
=
True
)
def
test_json2021
(
self
):
def
test_json2021
(
self
):
...
@@ -320,7 +320,7 @@ class ScheduleTests(TestCase):
...
@@ -320,7 +320,7 @@ class ScheduleTests(TestCase):
import_type
=
ScheduleJSONSupport
.
identifier
,
import_type
=
ScheduleJSONSupport
.
identifier
,
import_url
=
f
"
file://
{
Path
(
__file__
).
parent
.
joinpath
(
'
import_data
'
,
'
schedule-2021.json
'
)
}
"
,
import_url
=
f
"
file://
{
Path
(
__file__
).
parent
.
joinpath
(
'
import_data
'
,
'
schedule-2021.json
'
)
}
"
,
)
)
self
.
check_json
(
src
,
rooms
=
2
,
events
=
1
,
room_name
=
'
Gray Room
'
)
self
.
check_json
(
src
,
rooms
=
2
,
events
=
1
,
speakers
=
2
,
room_name
=
'
Gray Room
'
,
event_id
=
'
12345
'
)
@override_settings
(
SCHEDULES_SUPPORT_FILE_PROTOCOL
=
True
)
@override_settings
(
SCHEDULES_SUPPORT_FILE_PROTOCOL
=
True
)
def
test_json_frab
(
self
):
def
test_json_frab
(
self
):
...
@@ -340,9 +340,9 @@ class ScheduleTests(TestCase):
...
@@ -340,9 +340,9 @@ class ScheduleTests(TestCase):
import_type
=
ScheduleJSONFrabSupport
.
identifier
,
import_type
=
ScheduleJSONFrabSupport
.
identifier
,
import_url
=
f
"
file://
{
Path
(
__file__
).
parent
.
joinpath
(
'
import_data
'
,
'
frab.schedule.json
'
)
}
"
,
import_url
=
f
"
file://
{
Path
(
__file__
).
parent
.
joinpath
(
'
import_data
'
,
'
frab.schedule.json
'
)
}
"
,
)
)
self
.
check_json
(
src
,
rooms
=
3
,
events
=
1
,
room_name
=
'
Saal 1
'
,
event_id
=
'
12338
'
)
self
.
check_json
(
src
,
rooms
=
3
,
events
=
1
,
speakers
=
3
,
room_name
=
'
Saal 1
'
,
event_id
=
'
12338
'
)
def
check_json
(
self
,
src
,
rooms
,
events
,
room_name
=
'
Gray Room
'
,
event_id
=
'
12345
'
):
def
check_json
(
self
,
src
:
ScheduleSource
,
rooms
:
int
,
events
:
int
,
speakers
:
int
,
room_name
:
str
,
event_id
:
str
):
self
.
assertFalse
(
src
.
has_running_import
)
self
.
assertFalse
(
src
.
has_running_import
)
job
=
src
.
imports
.
create
(
state
=
ScheduleSourceImport
.
State
.
PREPARED
)
job
=
src
.
imports
.
create
(
state
=
ScheduleSourceImport
.
State
.
PREPARED
)
...
@@ -371,7 +371,7 @@ class ScheduleTests(TestCase):
...
@@ -371,7 +371,7 @@ class ScheduleTests(TestCase):
self
.
assertIsNotNone
(
e1
)
self
.
assertIsNotNone
(
e1
)
# check that mappings exist
# check that mappings exist
self
.
assertEqual
(
rooms
+
events
,
src
.
mappings
.
count
())
# 3 = 2 rooms + 1 event
self
.
assertEqual
(
rooms
+
events
+
speakers
,
src
.
mappings
.
count
())
r1_m
=
src
.
mappings
.
get
(
mapping_type
=
ScheduleSourceMapping
.
MappingType
.
ROOM
,
source_id
=
room_name
,
local_id
=
r1
.
id
)
r1_m
=
src
.
mappings
.
get
(
mapping_type
=
ScheduleSourceMapping
.
MappingType
.
ROOM
,
source_id
=
room_name
,
local_id
=
r1
.
id
)
e1_m
=
src
.
mappings
.
get
(
mapping_type
=
ScheduleSourceMapping
.
MappingType
.
EVENT
,
source_id
=
event_id
,
local_id
=
e1
.
id
)
e1_m
=
src
.
mappings
.
get
(
mapping_type
=
ScheduleSourceMapping
.
MappingType
.
EVENT
,
source_id
=
event_id
,
local_id
=
e1
.
id
)
self
.
assertIsNotNone
(
r1_m
)
self
.
assertIsNotNone
(
r1_m
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment