* Nicholas Bamber <[email protected]>, 2012-06-30, 19:21:
I wrote this simple test file:
Test(desc = 'Testing the mysql build cycle',
    cms = 'echo hello',
    post = FileContains('hello'))

I got the following output:
sisyphus@taylor:~/mysql-5.5/def$ atheist mysql.test
[EE] Loading plugin 'inotify-runner': No module named pyinotify
[EE] | Traceback (most recent call last):
[EE] |   File "/usr/lib/python2.7/dist-packages/atheist/__init__.py", line 135, 
in exec_file
[EE] |     exec(code) in _global, _local  # EXEC TEST FILE
[EE] |   File "/home/sisyphus/mysql-5.5/def/mysql.test", line 3, in <module>
[EE] |     post = FileContains('hello'))
[EE] |   File "/usr/lib/python2.7/dist-packages/atheist/manager.py", line 212, 
in __call__
[EE] |     return self.cls(self.mng, *args, **kargs)
[EE] |   File "/usr/lib/python2.7/dist-packages/pyarco/Type.py", line 256, in 
__call__
[EE] |     return self.func(*args, **kwargs)
[EE] | TypeError: __init__() takes exactly 3 arguments (2 given)
[EE] Errors in the testcase definition '/home/sisyphus/mysql-5.5/def/mysql.test'

There are two bugs in the code:

1) Typo: s/cms/cmd/.

2) post in a keyword argument for the Test constructor.

So your test case should be rewritten as:

t = Test(desc = 'Testing the mysql build cycle',
     cmd = 'echo hello')
t.post += FileContains('hello')

--
Jakub Wilk


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to