scanner: Add a base class for queued Tasks

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2021-08-25 10:41:39 -04:00
parent 73646fc106
commit 065c192714
3 changed files with 17 additions and 0 deletions

View File

@ -1,2 +1,3 @@
# Copyright 2021 (c) Anna Schumaker.
from . import metadata
from . import task

5
scanner/task.py Normal file
View File

@ -0,0 +1,5 @@
# Copyright 2021 (c) Anna Schumaker.
from gi.repository import GObject
class Task(GObject.GObject):
def run_task(self): raise NotImplementedError

11
scanner/test_task.py Normal file
View File

@ -0,0 +1,11 @@
# Copyright 2021 (c) Anna Schumaker.
import unittest
from gi.repository import GObject
from . import task
class TestScannerTask(unittest.TestCase):
def test_scanner_task_init(self):
t = task.Task()
self.assertIsInstance(t, GObject.GObject)
with self.assertRaises(NotImplementedError):
t.run_task()