
from time import sleep
import unittest
import os
import cairis.bin.cairisd

__author__ = 'Robin Quetin'


class CairisDaemonTestCase(unittest.TestCase):
  cmd = os.environ['CAIRIS_SRC'] + "/test/initdb.sh"
  os.system(cmd)
  app = cairis.bin.cairisd.main(['-d', '--unit-test'])
  sleep(1)


from time import sleep
import unittest
import os
import cairis.bin.cairisd

__author__ = 'Robin Quetin'


class CairisDaemonTestCase(unittest.TestCase):
  srcRoot = os.environ['CAIRIS_SRC']
  createDbSql = srcRoot + '/test/createdb.sql'
  sqlDir = srcRoot + '/sql'
  initSql = sqlDir + '/init.sql'
  procsSql = sqlDir + '/procs.sql'
  cmd = "/usr/bin/mysql --user=root --password='' < " + createDbSql
  os.system(cmd)
  cmd = "/usr/bin/mysql --user=irisuser --password='' --database=arm < " + initSql
  os.system(cmd)
  cmd = "/usr/bin/mysql --user=irisuser --password='' --database=arm < " + procsSql
  os.system(cmd)
  app = cairis.bin.cairisd.main(['-d', '--unit-test'])
  sleep(1)

Change database init script for daemon tests
Change database init script for daemon tests

  
  from time import sleep
  import unittest
  import os
  import cairis.bin.cairisd
  
  __author__ = 'Robin Quetin'
  
  
  class CairisDaemonTestCase(unittest.TestCase):
-   cmd = os.environ['CAIRIS_SRC'] + "/test/initdb.sh"
+   srcRoot = os.environ['CAIRIS_SRC']
+   createDbSql = srcRoot + '/test/createdb.sql'
+   sqlDir = srcRoot + '/sql'
+   initSql = sqlDir + '/init.sql'
+   procsSql = sqlDir + '/procs.sql'
+   cmd = "/usr/bin/mysql --user=root --password='' < " + createDbSql
+   os.system(cmd)
+   cmd = "/usr/bin/mysql --user=irisuser --password='' --database=arm < " + initSql
+   os.system(cmd)
+   cmd = "/usr/bin/mysql --user=irisuser --password='' --database=arm < " + procsSql
    os.system(cmd)
    app = cairis.bin.cairisd.main(['-d', '--unit-test'])
    sleep(1)
  
Change database init script for daemon tests
## Code Before:

from time import sleep
import unittest
import os
import cairis.bin.cairisd

__author__ = 'Robin Quetin'


class CairisDaemonTestCase(unittest.TestCase):
  cmd = os.environ['CAIRIS_SRC'] + "/test/initdb.sh"
  os.system(cmd)
  app = cairis.bin.cairisd.main(['-d', '--unit-test'])
  sleep(1)

## Instruction:
Change database init script for daemon tests
## Code After:

from time import sleep
import unittest
import os
import cairis.bin.cairisd

__author__ = 'Robin Quetin'


class CairisDaemonTestCase(unittest.TestCase):
  srcRoot = os.environ['CAIRIS_SRC']
  createDbSql = srcRoot + '/test/createdb.sql'
  sqlDir = srcRoot + '/sql'
  initSql = sqlDir + '/init.sql'
  procsSql = sqlDir + '/procs.sql'
  cmd = "/usr/bin/mysql --user=root --password='' < " + createDbSql
  os.system(cmd)
  cmd = "/usr/bin/mysql --user=irisuser --password='' --database=arm < " + initSql
  os.system(cmd)
  cmd = "/usr/bin/mysql --user=irisuser --password='' --database=arm < " + procsSql
  os.system(cmd)
  app = cairis.bin.cairisd.main(['-d', '--unit-test'])
  sleep(1)
