Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9339535
test_task.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
816 B
Subscribers
None
test_task.py
View Options
# Copyright (C) 2015 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
import
unittest
from
nose.tools
import
istest
from
swh.scheduler
import
task
class
Task
(
unittest
.
TestCase
):
@istest
def
not_implemented_task
(
self
):
class
NotImplementedTask
(
task
.
Task
):
pass
with
self
.
assertRaises
(
NotImplementedError
):
NotImplementedTask
()
.
run
()
@istest
def
add_task
(
self
):
class
AddTask
(
task
.
Task
):
def
run_task
(
self
,
x
,
y
):
return
x
+
y
r
=
AddTask
()
.
apply
([
2
,
3
])
self
.
assertTrue
(
r
.
successful
())
self
.
assertEqual
(
r
.
result
,
5
)
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Jul 4 2025, 9:45 AM (5 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3286336
Attached To
rDSCH Scheduling utilities
Event Timeline
Log In to Comment