Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
engine
Commits
8e78f71b
Verified
Commit
8e78f71b
authored
8 months ago
by
David Trattnig
Committed by
Ole Binder
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
test: update test cases to handle virtual timeslots
parent
2b96eeeb
No related branches found
No related tags found
1 merge request
!46
Steering playout schema and virtual timeslot integration
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_scheduling_api_fetcher.py
+12
-10
12 additions, 10 deletions
tests/test_scheduling_api_fetcher.py
with
12 additions
and
10 deletions
tests/test_scheduling_api_fetcher.py
+
12
−
10
View file @
8e78f71b
...
@@ -164,6 +164,7 @@ class TestSchedulingApiFetcher(unittest.TestCase):
...
@@ -164,6 +164,7 @@ class TestSchedulingApiFetcher(unittest.TestCase):
self
.
assertEqual
(
1
,
ts1
.
playlists
.
timeslot
.
get_id
())
self
.
assertEqual
(
1
,
ts1
.
playlists
.
timeslot
.
get_id
())
self
.
assertEqual
(
"
test
"
,
ts1
.
playlists
.
timeslot
.
get_description
())
self
.
assertEqual
(
"
test
"
,
ts1
.
playlists
.
timeslot
.
get_description
())
self
.
assertEqual
(
False
,
ts1
.
playlists
.
timeslot
.
do_shuffle
())
self
.
assertEqual
(
False
,
ts1
.
playlists
.
timeslot
.
do_shuffle
())
self
.
assertEqual
(
False
,
ts1
.
is_virtual
())
# Test Timeslot 1 - timeslot playlist
# Test Timeslot 1 - timeslot playlist
pl
=
ts1
.
playlists
.
timeslot
pl
=
ts1
.
playlists
.
timeslot
...
@@ -231,14 +232,15 @@ class TestSchedulingApiFetcher(unittest.TestCase):
...
@@ -231,14 +232,15 @@ class TestSchedulingApiFetcher(unittest.TestCase):
self
.
assertEqual
(
"
Show 2
"
,
ts2
.
show
.
name
)
self
.
assertEqual
(
"
Show 2
"
,
ts2
.
show
.
name
)
self
.
assertEqual
(
"
Episode 6
"
,
ts2
.
episode
.
title
)
self
.
assertEqual
(
"
Episode 6
"
,
ts2
.
episode
.
title
)
self
.
assertEqual
(
111
,
ts2
.
playlists
.
timeslot
.
get_id
())
self
.
assertEqual
(
111
,
ts2
.
playlists
.
timeslot
.
get_id
())
self
.
assertEqual
(
"
test
"
,
ts
1
.
playlists
.
timeslot
.
get_description
())
self
.
assertEqual
(
"
playlist 111
"
,
ts
2
.
playlists
.
timeslot
.
get_description
())
self
.
assertEqual
(
Fals
e
,
ts
1
.
playlists
.
timeslot
.
do_shuffle
())
self
.
assertEqual
(
Tru
e
,
ts
2
.
playlists
.
timeslot
.
do_shuffle
())
self
.
assertEqual
(
1
,
ts2
.
playlists
.
schedule
.
id
)
self
.
assertEqual
(
1
,
ts2
.
playlists
.
schedule
.
id
)
self
.
assertEqual
(
"
test
"
,
ts
1
.
playlists
.
schedule
.
get_description
())
self
.
assertEqual
(
"
test
"
,
ts
2
.
playlists
.
schedule
.
get_description
())
self
.
assertEqual
(
False
,
ts
1
.
playlists
.
schedule
.
do_shuffle
())
self
.
assertEqual
(
False
,
ts
2
.
playlists
.
schedule
.
do_shuffle
())
self
.
assertEqual
(
1
,
ts2
.
playlists
.
show
.
id
)
self
.
assertEqual
(
1
,
ts2
.
playlists
.
show
.
id
)
self
.
assertEqual
(
"
test
"
,
ts1
.
playlists
.
show
.
get_description
())
self
.
assertEqual
(
"
test
"
,
ts2
.
playlists
.
show
.
get_description
())
self
.
assertEqual
(
False
,
ts1
.
playlists
.
show
.
do_shuffle
())
self
.
assertEqual
(
False
,
ts2
.
playlists
.
show
.
do_shuffle
())
self
.
assertEqual
(
False
,
ts2
.
is_virtual
())
# Test Timeslot 2 - timeslot playlist
# Test Timeslot 2 - timeslot playlist
pl
=
ts2
.
playlists
.
timeslot
pl
=
ts2
.
playlists
.
timeslot
...
@@ -299,7 +301,7 @@ class TestSchedulingApiFetcher(unittest.TestCase):
...
@@ -299,7 +301,7 @@ class TestSchedulingApiFetcher(unittest.TestCase):
self
.
assertIsNone
(
pl_items
[
5
].
next
)
self
.
assertIsNone
(
pl_items
[
5
].
next
)
@mock.patch
(
"
aura_engine.base.api.requests.get
"
,
side_effect
=
mocked_requests_get
)
@mock.patch
(
"
aura_engine.base.api.requests.get
"
,
side_effect
=
mocked_requests_get
)
def
test_fetch_timeslot
_without_playlists
(
self
,
mock_get
):
def
test_fetch_
virtual_
timeslot
(
self
,
mock_get
):
print
(
self
.
_testMethodName
)
print
(
self
.
_testMethodName
)
# Clear cache to keep test cases isolated
# Clear cache to keep test cases isolated
...
@@ -323,12 +325,12 @@ class TestSchedulingApiFetcher(unittest.TestCase):
...
@@ -323,12 +325,12 @@ class TestSchedulingApiFetcher(unittest.TestCase):
self
.
assertEqual
(
4
,
ts
.
show
.
id
)
self
.
assertEqual
(
4
,
ts
.
show
.
id
)
self
.
assertEqual
(
"
Show 4 - Fallback show with virtual timeslot
"
,
ts
.
show
.
name
)
self
.
assertEqual
(
"
Show 4 - Fallback show with virtual timeslot
"
,
ts
.
show
.
name
)
self
.
assertIsNone
(
ts
.
episode
)
self
.
assertIsNone
(
ts
.
episode
)
self
.
assertEqual
(
True
,
ts
.
is_virtual
())
# Test Timeslot 1 - there are no playlists assigned
# Test Timeslot 1 - there are no playlists assigned
self
.
assertIsNone
(
ts
.
playlists
.
timeslot
)
self
.
assertIsNone
(
ts
.
playlists
.
timeslot
)
# FIXME
self
.
assertIsNone
(
ts
.
playlists
.
schedule
)
# self.assertIsNone(ts.playlists.schedule)
self
.
assertIsNone
(
ts
.
playlists
.
show
)
# self.assertIsNone(ts.playlists.show)
@mock.patch
(
"
aura_engine.base.api.requests.get
"
,
side_effect
=
mocked_requests_get
)
@mock.patch
(
"
aura_engine.base.api.requests.get
"
,
side_effect
=
mocked_requests_get
)
def
test_fetch_with_expanded_duration
(
self
,
mock_get
):
def
test_fetch_with_expanded_duration
(
self
,
mock_get
):
...
...
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