def test_parse_interface(self): task = build_task( "ListParameterTask", param="[1,2]", param_typed="['2','3']", param_custom_typed="A,B", ) assert task.param == [1, 2] assert task.param_typed == [2, 3] assert task.param_custom_typed == ["__A", "__B"]
def test_parse_interface(self): task = build_task("DateHourTask", dh="2013-02-01T18") assert task.dh == datetime.datetime(2013, 2, 1, 18, 0, 0, tzinfo=utc)
def test_parse_interface(self): task = build_task("DateTask", day="2015-04-03") assert task.day == datetime.date(2015, 4, 3)
def test_parse_interface(self): task = build_task("YearTask", year="2015") assert task.year == datetime.date(2015, 1, 1)
def test_parse_interface(self): task = build_task("MonthTask", month="2015-04") assert task.month == datetime.date(2015, 4, 1)
def test_parse_interface(self): task = build_task("DateSecondTask", ds="2013-02-01T184227") assert task.ds == datetime.datetime(2013, 2, 1, 18, 42, 27, tzinfo=utc)
def test_parse_interface(self): task = build_task("DateMinuteTask", dm="2013-02-01T1842") assert task.dm == datetime.datetime(2013, 2, 1, 18, 42, 0, tzinfo=utc)
def test_parse_interface(self): task = build_task("DictParameterTask", param='{"username": "******", "password": "******"}') assert TestDictParameter._dict == task.param
def test_parse_cmd_line(self): task = build_task("SetParameterTask", param="[1,2]", param_typed="['2','3']") assert task.param == {1, 2} assert task.param_typed == {2, 3}