Пример #1
0
    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"]
Пример #2
0
 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)
Пример #3
0
 def test_parse_interface(self):
     task = build_task("DateTask", day="2015-04-03")
     assert task.day == datetime.date(2015, 4, 3)
Пример #4
0
 def test_parse_interface(self):
     task = build_task("YearTask", year="2015")
     assert task.year == datetime.date(2015, 1, 1)
Пример #5
0
 def test_parse_interface(self):
     task = build_task("MonthTask", month="2015-04")
     assert task.month == datetime.date(2015, 4, 1)
Пример #6
0
 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)
Пример #7
0
 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)
Пример #8
0
 def test_parse_interface(self):
     task = build_task("DictParameterTask",
                       param='{"username": "******", "password": "******"}')
     assert TestDictParameter._dict == task.param
Пример #9
0
 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}