forked from modoboa/modoboa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
33 lines (25 loc) · 801 Bytes
/
tests.py
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
# coding: utf-8
import tempfile
import unittest
from modoboa.lib.sysutils import exec_cmd
class DeployTest(unittest.TestCase):
dbtype = "postgres"
dbhost = "localhost"
projname = "modoboa_test"
dbuser = "postgres"
dbpassword = ""
def setUp(self):
self.workdir = tempfile.mkdtemp()
def test_silent(self):
dburl = "default:%s://%s:%s@%s/%s" \
% (self.dbtype, self.dbuser, self.dbpassword,
self.dbhost, self.projname)
cmd = (
"modoboa-admin.py deploy --collectstatic "
"--dburl %s --domain %s %s"
% (dburl, 'localhost', self.projname)
)
code, output = exec_cmd(cmd, cwd=self.workdir)
self.assertEqual(code, 0)
if __name__ == "__main__":
unittest.main()