fix: add actioner property for ImportHandler
This commit is contained in:
parent
ead51bcd5a
commit
c873cc462e
2 changed files with 18 additions and 0 deletions
|
|
@ -210,6 +210,17 @@ class ImportHandler( # pylint: disable=too-many-public-methods,too-many-instanc
|
|||
""" """
|
||||
return self.get_title()
|
||||
|
||||
@property
|
||||
def actioner(self):
|
||||
"""
|
||||
Convenience property which effectively returns the
|
||||
:attr:`orientation` as a noun - i.e. one of:
|
||||
|
||||
* ``'importer'``
|
||||
* ``'exporter'``
|
||||
"""
|
||||
return f"{self.orientation.value}er"
|
||||
|
||||
@property
|
||||
def actioning(self):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -27,6 +27,13 @@ class TestImportHandler(DataTestCase):
|
|||
handler.target_title = "Wutta"
|
||||
self.assertEqual(str(handler), "CSV → Wutta")
|
||||
|
||||
def test_actioner(self):
|
||||
handler = self.make_handler()
|
||||
self.assertEqual(handler.actioner, "importer")
|
||||
|
||||
handler.orientation = mod.Orientation.EXPORT
|
||||
self.assertEqual(handler.actioner, "exporter")
|
||||
|
||||
def test_actioning(self):
|
||||
handler = self.make_handler()
|
||||
self.assertEqual(handler.actioning, "importing")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue