Esempio n. 1
0
 def test_deps_are_correctly_read(self):
     """
     tests read_sys_deps returns correct structure
     """
     deps_list = [
         'libpq-dev',
         'python3-numpy',
         'libxml2-dev',
         'libxslt1-dev',
         'zlib1g-dev',
     ]
     install_django_app = InstallDjangoApp(self.dist_version, self.log_file, self.log_level, venv=self.venv)
     deps = install_django_app.read_sys_deps(self.sys_deps_file)
     self.assertEqual(deps_list, deps, deps)
Esempio n. 2
0
 def test_install_sys_deps(self):
     """
     tests install_sys_deps calls apt-get install command, exits on error and writes to log
     """
     if self.dist_version == '14.04':
         self.python_version = 'python3.4'
     elif self.dist_version == '16.04':
         self.python_version = 'python3.5'
     install_django_app = InstallDjangoApp(self.dist_version, self.log_file, self.log_level, venv=self.venv)
     deps = install_django_app.read_sys_deps(self.sys_deps_file)
     cmd = ['apt-get',
            'install',
            '-y',
            'libpq-dev',
            'python3-numpy',
            'libxml2-dev',
            'libxslt1-dev',
            'zlib1g-dev']
     msg = 'successfully installed: libpq-dev python3-numpy libxml2-dev libxslt1-dev zlib1g-dev'
     func = 'install_sys_deps'
     args = (deps,)
     self.run_success([cmd], [msg], func, install_django_app.install_sys_deps, args)
     self.run_error(cmd, func, install_django_app.install_sys_deps, args)