示例#1
0
 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)
示例#2
0
 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'
示例#3
0
 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'
示例#4
0
 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'
示例#5
0
 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'
示例#6
0
 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'
示例#7
0
 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'
示例#8
0
 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'
示例#9
0
 def test_p_api_params_exit2(self):
   argv = [0,1,2,3]
   params.p_api_params(argv)
示例#10
0
 def test_p_api_params_exit1(self):
   argv = [0,1]
   params.p_api_params(argv)