summaryrefslogtreecommitdiff
path: root/obnam
diff options
context:
space:
mode:
authorLars Wirzenius <liw@gytha>2008-03-23 13:21:28 +0200
committerLars Wirzenius <liw@gytha>2008-03-23 13:21:28 +0200
commit729479b5fec9911c0c4ffdb512489d4e21055e17 (patch)
treefab884e3dd9549ef71610f2ba2abbcffe395520e /obnam
parent1d8f531708cf7c597c6e94121492763b99a2d5fb (diff)
downloadobnam-729479b5fec9911c0c4ffdb512489d4e21055e17.tar.gz
Have obnam.Operation remember the obnam.Application instance it was given.
Diffstat (limited to 'obnam')
-rw-r--r--obnam/oper.py6
-rw-r--r--obnam/operTests.py8
2 files changed, 11 insertions, 3 deletions
diff --git a/obnam/oper.py b/obnam/oper.py
index f174d631..d610e335 100644
--- a/obnam/oper.py
+++ b/obnam/oper.py
@@ -23,4 +23,8 @@ class Operation:
name = None
def __init__(self, app, args):
- pass
+ self._app = app
+
+ def get_application(self):
+ """Return application this operation instance will use."""
+ return self._app
diff --git a/obnam/operTests.py b/obnam/operTests.py
index 272bf23c..d9dfd334 100644
--- a/obnam/operTests.py
+++ b/obnam/operTests.py
@@ -27,8 +27,12 @@ class OperationTests(unittest.TestCase):
def setUp(self):
context = obnam.context.Context()
- app = obnam.Application(context)
- self.op = obnam.Operation(app, ["pink", "pretty"])
+ self.app = obnam.Application(context)
+ self.args = ["pink", "pretty"]
+ self.op = obnam.Operation(self.app, self.args)
def testNameIsNone(self):
self.failUnlessEqual(self.op.name, None)
+
+ def testHasRightApplication(self):
+ self.failUnlessEqual(self.op.get_application(), self.app)