mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Adding Travis support.
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
language: python
|
||||
python:
|
||||
- "2.6"
|
||||
- "2.7"
|
||||
|
||||
services: mysql
|
||||
|
||||
install:
|
||||
- python setup.py -q install
|
||||
|
||||
before_script:
|
||||
- mysql -e 'create database modoboa_test;'
|
||||
|
||||
script:
|
||||
- PYTHONPATH=tests python -m unittest install_from_scratch
|
||||
@@ -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