annotate tests/test_waiter.py @ 18:56596902e9ae default tip

add some setup + tests
author Jeff Hammel <k0scist@gmail.com>
date Sun, 10 Dec 2017 17:57:03 -0800
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
1 #!/usr/bin/env python
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
2
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
3 """
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
4 test bash waiting function
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
5 """
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
6
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
7 import os
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
8 import shutil
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
9 import tempfile
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
10 import unittest
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
11 from lemuriformes import waiter
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
12
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
13 string = (str, unicode)
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
14
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
15
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
16 class TestWaiter(unittest.TestCase):
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
17
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
18 def test_render(self):
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
19 commands = ['echo {}'.format(item)
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
20 for item in ('hello', 'world')]
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
21 hello = str(waiter.BashWaiter(*commands))
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
22 assert isinstance(hello, string)
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
23
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
24
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
25 if __name__ == '__main__':
56596902e9ae add some setup + tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
26 unittest.main()