fix: add actioner property for ImportHandler

This commit is contained in:
Lance Edgar 2026-01-03 10:54:00 -06:00
parent ead51bcd5a
commit c873cc462e
2 changed files with 18 additions and 0 deletions

View file

@ -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):
"""

View file

@ -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")