diff --git a/.gitignore b/.gitignore index 4780b65..6e57a1e 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,4 @@ target/ # doc doc/html +*.sw[pon] diff --git a/doc/first_project.rst b/doc/first_project.rst index 0d6e32c..2f56634 100644 --- a/doc/first_project.rst +++ b/doc/first_project.rst @@ -131,8 +131,8 @@ By default, the ``oct new-project`` command will create an exemple test script u class Transaction(BaseTransaction): - def __init__(self, config): - super(Transaction, self).__init__(config) + def __init__(self, config, context=None): + super(Transaction, self).__init__(config, context) def setup(self): """Setup data or objects here diff --git a/doc/writing_tests.rst b/doc/writing_tests.rst index a1b236b..7d359de 100644 --- a/doc/writing_tests.rst +++ b/doc/writing_tests.rst @@ -20,8 +20,8 @@ Let's take the default ``v_user.py`` file : class Transaction(BaseTransaction): - def __init__(self, config): - super(Transaction, self).__init__(config) + def __init__(self, config, context=None): + super(Transaction, self).__init__(config, context) def setup(self): """Setup data or objects here @@ -60,8 +60,8 @@ So first let's adapt the script to our needs: class Transaction(BaseTransaction): - def __init__(self, config): - super(Transaction, self).__init__(config) + def __init__(self, config, context=None): + super(Transaction, self).__init__(config, context) # each cannon will only instanciate Transaction once, so each property # in the Transaction __init__ method will be set only once so take care if you need to update it self.url = "http://my-api/1.0/" @@ -123,8 +123,8 @@ How does it works ? Take a look a this example: class Transaction(BaseTransaction): - def __init__(self, config): - super(Transaction, self).__init__(config) + def __init__(self, config, context=None): + super(Transaction, self).__init__(config, context) # each cannon will only instanciate Transaction once, so each property # in the Transaction __init__ method will be set only once so take care if you need to update it self.url = "http://my-api/1.0/" diff --git a/oct/utilities/templates/scripts/v_user.j2 b/oct/utilities/templates/scripts/v_user.j2 index cf31b9a..02d8a97 100644 --- a/oct/utilities/templates/scripts/v_user.j2 +++ b/oct/utilities/templates/scripts/v_user.j2 @@ -5,8 +5,8 @@ import time class Transaction(BaseTransaction): - def __init__(self, config): - super(Transaction, self).__init__(config) + def __init__(self, config, context=None): + super(Transaction, self).__init__(config, context) def setup(self): """Setup data or objects here