def test_main(self): t = timedelta(days = 5) d = datetime.today() - t dp = datetime.strftime(d,'%Y%m%d') arg = ['dummy',dp,dp] param = params.p_api_params(arg) actual = client.main(param)
def test_create_ctrls_from_p2(self): argv = [0, 20150801, 20150803, 'tvdms'] p = params.p_api_params(argv) actual = p.create_ctrls_from_params('download') assert len(actual) == 3 assert str(actual[0]) == 'maker_id=1,data_type=tv_dms,data_date=20150801,status=download' assert str(actual[1]) == 'maker_id=1,data_type=tv_dms,data_date=20150802,status=download' assert str(actual[2]) == 'maker_id=1,data_type=tv_dms,data_date=20150803,status=download'
def test_create_ctrls_from_p3(self): argv = [0, 20150801, 20150801] p = params.p_api_params(argv) actual = p.create_ctrls_from_params('start') assert len(actual) == len(params.TYPE_DIC) assert str(actual[0]) == 'maker_id=1,data_type=epg,data_date=20150801,status=start' assert str(actual[1]) == 'maker_id=1,data_type=playlist,data_date=20150801,status=start' assert str(actual[2]) == 'maker_id=1,data_type=playlist_zenroku,data_date=20150801,status=start' assert str(actual[3]) == 'maker_id=1,data_type=tv_dms,data_date=20150801,status=start' assert str(actual[4]) == 'maker_id=1,data_type=tv_info,data_date=20150801,status=start' assert str(actual[5]) == 'maker_id=1,data_type=tv_play,data_date=20150801,status=start'
def test_create_ctrls_from_p1(self): argv = [0, 20150801, 20150801, 'epg'] p = params.p_api_params(argv) actual = p.create_ctrls_from_params('start') assert len(actual) == 1 assert str(actual[0]) == 'maker_id=1,data_type=epg,data_date=20150801,status=start'
def test_p_api_params_init4(self): argv = [0, 20150801, 20150815] actual = params.p_api_params(argv) assert actual.get_paramq() == '?start=20150801&end=20150815'
def test_p_api_params_init3(self): argv = [0, 20150801, 20150815, 'zenplay'] actual = params.p_api_params(argv) assert actual.get_paramq() == '?start=20150801&end=20150815&type=zenplay'
def test_p_api_params_init1(self): argv = [0, 20150801, 20150801, 'epg'] actual = params.p_api_params(argv) assert actual.get_paramq() == '?start=20150801&end=20150801&type=epg'
def test_p_api_params_noexit(self): argv = [0,1,2] actual = params.p_api_params(argv) assert actual.get_paramq() == '?start=1&end=2'
def test_p_api_params_exit2(self): argv = [0,1,2,3] params.p_api_params(argv)
def test_p_api_params_exit1(self): argv = [0,1] params.p_api_params(argv)