Beispiel #1
0
    def test_configure_without_venv(self):

        with fixtures.EnvironmentVariable('VIRTUAL_ENV'):
            cfgfile = self.create_tempfiles(
                [(os.path.join(os.path.expanduser('~'),
                               'tvrenamer'),
                    ''.join(self.cfg_data))])[0]
            self.addCleanup(os.removedirs, os.path.dirname(cfgfile))
            self.addCleanup(os.unlink, cfgfile)
            service._configure([])
            self.assertEqual(cfg.CONF.libraries, ['/tmp/junk'])
Beispiel #2
0
    def test_configure_with_venv(self):

        vdir = tempfile.mkdtemp()
        dirname = os.path.join(vdir, 'etc')
        os.mkdir(dirname)
        self.addCleanup(os.removedirs, dirname)

        with fixtures.EnvironmentVariable('VIRTUAL_ENV', vdir):
            cfgfile = self.create_tempfiles(
                [(os.path.join(dirname, 'tvrenamer'),
                  ''.join(self.cfg_data))])[0]
            self.addCleanup(os.unlink, cfgfile)
            service._configure([])
            self.assertEqual(cfg.CONF.libraries, ['/tmp/junk'])
Beispiel #3
0
 def test_configure_no_config_file(self):
     service._configure([])
     self.assertTrue(True)