blob: 7241b193c7c655a5016e1b982342768a2cfcd7ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_g_sorcery.py
~~~~~~~~~~~~~~~~~
executable and main module test suite
:copyright: (c) 2013 by Jauhien Piatlicki
:license: GPL-2, see LICENSE for more details.
"""
import os, subprocess, tempfile, unittest
class TestBin(unittest.TestCase):
def setUp(self):
self.tempdir = tempfile.TemporaryDirectory()
def tearDown(self):
del self.tempdir
def test_g_sorcery(self):
binpath = os.path.join(os.path.split(
os.path.dirname(os.path.realpath(__file__)))[0], 'bin')
binary = os.path.join(binpath, 'g-sorcery')
self.assertEqual(subprocess.check_output(binary), b'it works\n')
def suite():
suite = unittest.TestSuite()
suite.addTest(TestBin('test_g_sorcery'))
return suite
|