mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-20 06:08:35 +02:00
Adding Travis support.
This commit is contained in:
@@ -12,27 +12,17 @@ class DeployTest(unittest.TestCase):
|
||||
dbtype = "mysql"
|
||||
dbhost = "localhost"
|
||||
projname = "modoboa_test"
|
||||
dbuser = "root"
|
||||
dbpassword = "toto"
|
||||
dbuser = "travis"
|
||||
dbpassword = ""
|
||||
|
||||
def setUp(self):
|
||||
cmd = "mysqladmin -u %s -p%s create %s" % (self.dbuser, self.dbpassword, self.projname)
|
||||
code, out = exec_cmd(cmd)
|
||||
self.assertEqual(code, 0)
|
||||
self.workdir = tempfile.mkdtemp()
|
||||
|
||||
def tearDown(self):
|
||||
path = os.path.join(self.workdir, self.projname)
|
||||
code, output = exec_cmd("python manage.py test lib admin limits", cwd=path)
|
||||
code, output = exec_cmd("python manage.py test lib admin limits postfix_relay_domains", cwd=path)
|
||||
self.assertEqual(code, 0)
|
||||
|
||||
if hasattr(self, "workdir"):
|
||||
shutil.rmtree(self.workdir)
|
||||
child = pexpect.spawn("mysqladmin -u root -p%s drop %s" % (self.dbpassword, self.projname))
|
||||
child.expect("\[y/N\]")
|
||||
child.sendline("y")
|
||||
child.expect('Database "%s" dropped' % self.projname)
|
||||
|
||||
def test_standard(self):
|
||||
timeout = 2
|
||||
cmd = "modoboa-admin.py deploy --syncdb --collectstatic %s" % self.projname
|
||||
|
||||
Reference in New Issue
Block a user