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
18515fcb
Commit
18515fcb
authored
1 year ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
test: play state domain
parent
3e7d6a07
No related branches found
No related tags found
1 merge request
!35
ORM-less scheduling
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_domain.py
+43
-0
43 additions, 0 deletions
tests/test_domain.py
with
43 additions
and
0 deletions
tests/test_domain.py
+
43
−
0
View file @
18515fcb
...
@@ -21,6 +21,7 @@ import unittest
...
@@ -21,6 +21,7 @@ import unittest
from
aura_engine.base.config
import
AuraConfig
from
aura_engine.base.config
import
AuraConfig
from
aura_engine.base.logger
import
AuraLogger
from
aura_engine.base.logger
import
AuraLogger
from
aura_engine.core.channels
import
GenericChannel
from
aura_engine.resources
import
ResourceType
from
aura_engine.resources
import
ResourceType
from
aura_engine.scheduling.domain
import
(
from
aura_engine.scheduling.domain
import
(
Episode
,
Episode
,
...
@@ -309,6 +310,48 @@ class TestDomain(unittest.TestCase):
...
@@ -309,6 +310,48 @@ class TestDomain(unittest.TestCase):
str
(
item
),
str
(
item
),
)
)
def
test_playlist_item_play_state
(
self
):
print
(
self
.
_testMethodName
)
item
=
PlaylistItem
(
"
file1.flac
"
,
2
,
100
,
PlaylistItem
.
Metadata
(
"
a1
"
,
"
b1
"
,
"
c1
"
))
self
.
assertFalse
(
item
.
play
.
is_loading
())
self
.
assertFalse
(
item
.
play
.
is_ready
())
self
.
assertFalse
(
item
.
play
.
is_playing
())
self
.
assertFalse
(
item
.
play
.
is_done
())
self
.
assertIsNone
(
item
.
play
.
channel
)
item
.
play
.
set_loading
(
GenericChannel
(
1
,
"
main
"
,
None
))
self
.
assertTrue
(
item
.
play
.
is_loading
())
self
.
assertFalse
(
item
.
play
.
is_ready
())
self
.
assertFalse
(
item
.
play
.
is_playing
())
self
.
assertFalse
(
item
.
play
.
is_done
())
self
.
assertIsNotNone
(
item
.
play
.
channel
)
item
.
play
.
set_ready
()
self
.
assertFalse
(
item
.
play
.
is_loading
())
self
.
assertTrue
(
item
.
play
.
is_ready
())
self
.
assertFalse
(
item
.
play
.
is_playing
())
self
.
assertFalse
(
item
.
play
.
is_done
())
self
.
assertIsNone
(
item
.
play
.
start_time
)
item
.
play
.
set_playing
()
self
.
assertFalse
(
item
.
play
.
is_loading
())
self
.
assertFalse
(
item
.
play
.
is_ready
())
self
.
assertTrue
(
item
.
play
.
is_playing
())
self
.
assertFalse
(
item
.
play
.
is_done
())
self
.
assertIsNotNone
(
item
.
play
.
start_time
)
item
.
play
.
set_done
()
self
.
assertFalse
(
item
.
play
.
is_loading
())
self
.
assertFalse
(
item
.
play
.
is_ready
())
self
.
assertFalse
(
item
.
play
.
is_playing
())
self
.
assertTrue
(
item
.
play
.
is_done
())
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
unittest
.
main
()
unittest
.
main
()
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