def __test(): """ test function """ from raspiserver.utils import ConfigReader cfg_parser = ConfigReader('./config/raspicam.cfg') cfg = cfg_parser.parser() videocmd = RaspvidCmd(cfg.video) APPLOGGER.debug(videocmd.cmd())
def __run(): """ test run """ from raspiserver.utils import ConfigReader config_path = './config/raspicam.cfg' cfg_parser = ConfigReader(config_path) cfg = cfg_parser.parser() vodserve(cfg)
def test_post_start(self): """ test start command """ resp = requests.post(self.test_url + '/start') self.assertEqual(resp.status_code, 200) config_parser = ConfigReader('/home/pi/server/config/raspicam.cfg') cfg = config_parser.parser() vvpmng = VideoProcessMng(cfg.video) self.assertEqual(resp.text, vvpmng.process_cmd.cmd()) sleep(5)
def __run(): """ test function """ from raspiserver.utils import ConfigReader from raspiserver.recordmng import RecordMng from raspiserver.processmng import VideoProcessMng config_parser = ConfigReader('./config/raspicam.cfg') cfg = config_parser.parser() recmng = RecordMng(cfg.record) vvpmng = VideoProcessMng(cfg.video) httpserve(cfg, recmng, vvpmng)
def setup_class(self): """ real setup """ TestCase.setUp(self) config_parser = ConfigReader('/home/pi/server/config/raspicam.cfg') cfg = config_parser.parser() # test in local(Rpi) recmng = RecordMng(cfg.record) vvpmng = VideoProcessMng(cfg.video) self.testthr = threading.Thread(target=httpserve, \ args=(cfg, recmng, vvpmng)) self.testthr.setDaemon(True) self.testthr.start()
def __test(): """ test func """ from raspiserver.utils import ConfigReader cfg_parser = ConfigReader('./config/raspicam.cfg') cfg = cfg_parser.parser() recordmng = RecordMng(cfg.record) allfiles = recordmng.get_recordfiles() APPLOGGER.debug(allfiles) APPLOGGER.debug(len(allfiles)) APPLOGGER.debug(recordmng.get_freespaces()) APPLOGGER.debug(recordmng.have_space()) recordmng.lefthrhold = 330 recordmng.cycle = True APPLOGGER.debug(recordmng.have_space()) APPLOGGER.debug(recordmng.gen_recordfname())
def __test(): """ test func """ from raspiserver.utils import ConfigReader cfg_parser = ConfigReader("./config/raspicam.cfg") cfg = cfg_parser.parser() recordmng = RecordMng(cfg.record) allfiles = recordmng.get_recordfiles() APPLOGGER.debug(allfiles) APPLOGGER.debug(len(allfiles)) APPLOGGER.debug(recordmng.get_freespaces()) APPLOGGER.debug(recordmng.have_space()) recordmng.lefthrhold = 330 recordmng.cycle = True APPLOGGER.debug(recordmng.have_space()) APPLOGGER.debug(recordmng.gen_recordfname())
def main(): """ serve for all """ config_path = '/home/pi/server/config/raspicam.cfg' cfg_parser = ConfigReader(config_path) cfg = cfg_parser.parser() recmng = RecordMng(cfg.record) vvpmng = VideoProcessMng(cfg.video) global PROCESSMNG PROCESSMNG = vvpmng hyserve = HybirdServer() # you can start tcp server or http server try: hyserve.setservices('httpserver', httpserve, (cfg, recmng, vvpmng)) hyserve.setservices('tcpserver', tcpserve, (cfg, recmng, vvpmng)) hyserve.setservices('vodserver', vodserve, (cfg, )) hyserve.serve() except AppException as ex: APPLOGGER.error(ex)
def main(): """ serve for all """ config_path = '/home/pi/server/config/raspicam.cfg' cfg_parser = ConfigReader(config_path) cfg = cfg_parser.parser() recmng = RecordMng(cfg.record) vvpmng = VideoProcessMng(cfg.video) global PROCESSMNG PROCESSMNG = vvpmng hyserve = HybirdServer() # you can start tcp server or http server try: hyserve.setservices('httpserver', httpserve, (cfg, recmng, vvpmng)) hyserve.setservices('tcpserver', tcpserve, (cfg, recmng, vvpmng)) hyserve.setservices('vodserver', vodserve, (cfg,)) hyserve.serve() except AppException as ex: APPLOGGER.error(ex)
def test_config_reader(self): """ test get config """ config = './config/raspicam.cfg' parser = ConfigReader(config) cfg = parser.parser() self.assertEqual(cfg.comm_port.tcp_port, 9999) self.assertEqual(cfg.comm_port.http_port, 8080) self.assertEqual(cfg.comm_port.vod_port, 9001) self.assertEqual(cfg.video.width, 1280) self.assertEqual(cfg.video.height, 800) self.assertEqual(cfg.video.bitrate, 4500000) self.assertEqual(cfg.video.brightness, 50) self.assertEqual(cfg.video.fps, 30) self.assertEqual(cfg.video.rtsp_port, 9000) self.assertEqual(cfg.record.base, "'/home/pi/records'") self.assertEqual(cfg.record.cycle, True) self.assertEqual(cfg.record.fsp_limit, 3700)
def setUp(self): cfg_parser = ConfigReader('./config/raspicam.cfg') cfg = cfg_parser.parser() self.recordmng = RecordMng(cfg.record)
def __get_process_cmd(cls): """ get process_cmd """ config_parser = ConfigReader('/home/pi/server/config/raspicam.cfg') cfg = config_parser.parser() vvpmng = VideoProcessMng(cfg.video) return vvpmng.process_cmd.cmd()
def setUp(self): """ setup """ config_parser = ConfigReader('/home/pi/server/config/raspicam.cfg') cfg = config_parser.parser() cmd = RaspvidCmd(cfg.video) self.cmd = cmd
def setUp(self): """ setup """ config_parser = ConfigReader('/home/pi/server/config/raspicam.cfg') cfg = config_parser.parser() self.procssmng = VideoProcessMng(cfg.video)