Example #1
0
 def test_ajust_log_path_app_path(self):
   app_path = os.path.join('../', os.path.dirname(__file__), 'app-path')
   sys.argv[1:] = ['--app-path=%s' % app_path]
   opt = parser._parse_args()
   self.cli._set_loggers(opt)
   handlers = self.cli.log.handlers
   self.assertTrue(isinstance(handlers[0], logging.FileHandler))
   self.assertEquals(os.path.join(app_path, 'logs/wsgid.log'), handlers[0].baseFilename)
Example #2
0
 def test_ajust_log_path_app_path(self):
     app_path = os.path.join('../', os.path.dirname(__file__), 'app-path')
     sys.argv[1:] = ['--app-path=%s' % app_path]
     opt = parser._parse_args()
     self.cli._set_loggers(opt)
     handlers = self.cli.log.handlers
     self.assertTrue(isinstance(handlers[0], logging.FileHandler))
     self.assertEquals(os.path.join(app_path, 'logs/wsgid.log'),
                       handlers[0].baseFilename)
Example #3
0
 def setUp(self):
   self.cli = Cli()
   # As we are dealing with a command line test, we have do clean the passed arguments
   # so the tested applications does not try to use them
   sys.argv[1:] = []
   self.fake_app_path = os.path.join('../', os.path.dirname(__file__), 'app-path')
   
   # Ok, not pretty but better than re-implementing this in python
   os.system("rm -rf {0}".format(os.path.join(self.fake_app_path, 'pid/')))
   self.cli.options = parser._parse_args()
   self.cli.options.app_path = self.fake_app_path
Example #4
0
    def setUp(self, *args):
        self.cli = Cli()
        # As we are dealing with a command line test, we have do clean the passed arguments
        # so the tested applications does not try to use them
        sys.argv[1:] = []
        self.fake_app_path = os.path.join(fullpath(__file__), 'app-path')

        # Ok, not pretty but better than re-implementing this in python
        os.system("rm -rf {0}".format(os.path.join(self.fake_app_path,
                                                   'pid/')))
        self.cli.options = parser._parse_args()
        self.cli.options.app_path = self.fake_app_path

        CommandInit().run(FakeOptions(app_path=self.fake_app_path))
Example #5
0
 def test_parse_workers_as_integer(self):
   sys.argv[1:] = ['--workers=3']
   opts = parser._parse_args()
   self.assertTrue(type(int), opts.workers)
Example #6
0
 def test_parse_workers_as_integer(self):
     sys.argv[1:] = ['--workers=3']
     opts = parser._parse_args()
     self.assertTrue(type(int), opts.workers)