示例#1
0
 async def test(expected_result, calls=None):
     calls = calls or {}
     calls.setdefault(ACTIVE_PATH, object)
     calls.setdefault(FOLDER_CALL, None)
     calls.setdefault(FIRST_WORKSPACE, None)
     with setup_editor(calls) as editor:
         eq(await editor.project_path, expected_result)
示例#2
0
def test_filter_by_date_and_number():
    data = mod.TinyPanda(DATA)
    d0 = parse(D0)
    where = (data["d"].apply(parse) > d0) & (data["b"].apply(int) < 8)
    eq(repr(where),
       f"[parse(v['d']) > {d0!r} and int(v['b']) < 8 for v in {data}]")
    eq(list(data[where]), DATA[1:-1])
示例#3
0
def test_get():
    lru = LRUDict(3)
    for x in range(4):
        lru[x] = x * 2
        eq(lru.get(0), 0, "x: %s" % x)
    eq(lru.get(-1, -2), -2)
    assert_items_equal(lru, [(2, 4), (3, 6), (0, 0)])
示例#4
0
def test_memoized_function_get_cache():
    func = make_counter()
    mem_func = memoized(func)

    eq(mem_func(0), 1)
    cache = mem_func.get_cache()
    eq(cache, {(0, ): 1})
示例#5
0
def test_memoized_method_name():
    class Class:
        @memoized
        def a_rose(by_any, other_name):
            pass

    eq(Class.a_rose.__name__, "a_rose")
示例#6
0
def test_memoized_method():
    sub = Subject()
    eq(sub.mem_func(0), 1)
    eq(sub.func(0), 2)
    eq(sub.func(0), 3)
    eq(sub.mem_func(0), 1)
    eq(sub.mem_func(1), 5)
示例#7
0
 async def test(input_values, history_cache, client_calls):
     server = {"calls": []}
     with test_command(String("value")), fake_history():
         for value in input_values:
             await mod.do_command(server, [value])
         eq(history.cache, history_cache)
         eq(server["calls"], client_calls)
示例#8
0
def test_extract_criteria_config(self, case_type, data_registry,
                                 custom_related_case_property,
                                 expect_exception):
    with assert_raises(None if not expect_exception else CaseSearchUserError):
        request_dict = _make_request_dict({
            CASE_SEARCH_CASE_TYPE_KEY:
            case_type,
            CASE_SEARCH_REGISTRY_ID_KEY:
            data_registry,
            CASE_SEARCH_CUSTOM_RELATED_CASE_PROPERTY_KEY:
            custom_related_case_property,
            "other_key":
            "jim",
        })
        config = extract_search_request_config(request_dict)

    if not expect_exception:
        expected_case_types = case_type if isinstance(case_type,
                                                      list) else [case_type]
        eq(
            config,
            CaseSearchRequestConfig(
                criteria=[SearchCriteria("other_key", "jim")],
                case_types=expected_case_types,
                data_registry=data_registry,
                custom_related_case_property=custom_related_case_property))
示例#9
0
def test_public_only_session__simple_success():
    session = _set_up_session()
    with _patch_session_with_hard_coded_response(session,
                                                 'https://example.com/',
                                                 _get_200_response()):
        response = session.get('https://example.com/')
        eq(response.status_code, 200)
def test_start_stop_datetime_export():
    form_config_dict = get_form_config_dict()
    form_config_dict["openmrs_start_datetime"] = {
        "form_question": "/data/visit_datetime",
        "external_data_type": "omrs_datetime",
    }
    form_json = {
        "form": {
            "@xmlns":
            "http://openrosa.org/formdesigner/9ECA0608-307A-4357-954D-5A79E45C3879",
            "visit_datetime": "2018-01-01T12:00:00.00000Z",
            "meta": {
                "timeEnd": "2019-12-16T12:36:00.00000Z"
            },
        }
    }
    info = CaseTriggerInfo(domain="test-domain",
                           case_id="c0ffee",
                           form_question_values={
                               "/data/visit_datetime":
                               "2018-01-01T12:00:00.00000Z",
                               "/metadata/timeEnd":
                               "2019-12-16T12:36:00.00000Z",
                           })
    task = get_task(info, form_json, form_config_dict)
    start_datetime, stop_datetime = task._get_start_stop_datetime(
        OpenmrsFormConfig.wrap(form_config_dict))
    eq(start_datetime, "2018-01-01T12:00:00.000+0000")
    eq(stop_datetime, "2018-01-02T11:59:59.000+0000")
示例#11
0
def test_deletion_sql_models():
    covered_models = set(
        itertools.chain.from_iterable(op.get_model_classes()
                                      for op in DOMAIN_DELETE_OPERATIONS))

    def _ignore_model(model):
        if not model._meta.managed:
            return True

        if model._meta.app_label in IGNORE_APPS:
            return True

        if get_model_label(model) in IGNORE_MODELS:
            return True

        if model._meta.proxy:
            return model._meta.concrete_model in covered_models

    installed_models = {
        model
        for model in apps.get_models() if not _ignore_model(model)
    }

    uncovered_models = installed_models - covered_models
    eq(uncovered_models, set(),
       "Not all Django models are covered by domain deletion.")
def test_concept_directions():
    form_json = {
        "form": {
            "@xmlns":
            "http://openrosa.org/formdesigner/9ECA0608-307A-4357-954D-5A79E45C3879",
            "pneumonia": "no",
            "malnutrition": "no",
        }
    }
    form_config_dict = get_form_config_dict()
    form_config = OpenmrsFormConfig.wrap(form_config_dict)
    info = CaseTriggerInfo(domain="test-domain",
                           case_id="c0ffee",
                           form_question_values={
                               "/data/pneumonia": "no",
                               "/data/malnutrition": "no",
                           })
    task = get_task(info, form_json, form_config_dict)
    values_for_concepts = get_values_for_concept(form_config, task.info)
    eq(
        values_for_concepts,
        {
            # "direction": "out"
            'e7fdcd25-6d11-4d85-a80a-8979785f0f4b':
            ['eea8e4e9-4a91-416c-b0f5-ef0acfbc51c0'],
            # "direction": null, or not specified
            '4000cf24-8fab-437d-9950-ea8d9bb05a09':
            ['eea8e4e9-4a91-416c-b0f5-ef0acfbc51c0'],
            # "direction": "in" should be missing
        })
示例#13
0
def test_retry_with_delays():
    retry = mod.retry_on(Error, delays=[2**x for x in range(5)])
    func, calls = make_retry_function(retry, 6, Error)
    with mock_retry_sleep() as sleeps, assert_raises(Error):
        func(1)
    eq(sleeps, [1, 2, 4, 8, 16])
    eq(len(calls), 6)
示例#14
0
def test_retry_on_too_many_retries():
    retry = mod.retry_on(Error, OtherError)
    func, calls = make_retry_function(retry, 6, Error)
    with mock_retry_sleep() as sleeps, assert_raises(Error):
        func(1)
    eq(sleeps, [0.1, 1, 2, 4, 8])
    eq(len(calls), 6)
示例#15
0
async def test_redo_with_no_history():
    registry = command.REGISTRY
    server = {"calls": [], "history.get('cmd',)": []}
    with fake_history(), test_command(with_history=True):
        command.REGISTRY["history"] = registry["history"]
        actual_result = await do_command(server, ["history redo cmd"])
    eq(actual_result, error("cmd has no history"))
示例#16
0
def test_private_method_post():
    response = post_response("private_method")
    eq(response.status_code, 403)
    eq(
        response.content,
        b"Method 'RmiView.private_method' has no decorator '@allow_remote_invocation'"
    )
示例#17
0
def test_problem_forms():
    with init_state_db("test") as db:
        db.add_problem_form("abc")

    with init_state_db("test") as db:
        db.add_problem_form("def")
        eq(set(db.iter_problem_forms()), {"abc", "def"})
示例#18
0
 async def test(expected_path, file_path=None, project_path=None):
     calls = {
         ACTIVE_PATH: file_path,
         FIRST_WORKSPACE: project_path,
     }
     with setup_editor(calls) as editor:
         eq(await editor.dirname, expected_path)
示例#19
0
def test_replace_case_diffs():
    with init_db() as db:
        case_id = "865413246874321"
        # add old diffs
        db.replace_case_diffs([
            ("CommCareCase", case_id, [make_diff(0)]),
            ("stock state", case_id + "/x/y", [make_diff(1)]),
            ("CommCareCase", "unaffected", [make_diff(2)]),
            ("stock state", "unaffected/x/y", [make_diff(3)]),
            ("CommCareCase", "stock-only", [make_diff(4)]),
            ("stock state", "stock-only/x/y", [make_diff(5)]),
            ("CommCareCase", "gone", [make_diff(4)]),
            ("stock state", "gone/x/y", [make_diff(5)]),
        ])
        # add new diffs
        db.replace_case_diffs([
            ("CommCareCase", case_id, [make_diff(6)]),
            ("stock state", case_id + "/y/z", [make_diff(7)]),
            ("stock state", "stock-only/y/z", [make_diff(8)]),
            ("CommCareCase", "gone", []),
            ("stock state", "gone/x/y", []),
        ])
        eq(
            {(d.kind, d.doc_id, hashable(d.json_diff))
             for d in db.get_diffs()},
            {(kind, doc_id, hashable(make_diff(x)))
             for kind, doc_id, x in [
                 ("CommCareCase", "unaffected", 2),
                 ("stock state", "unaffected/x/y", 3),
                 ("CommCareCase", case_id, 6),
                 ("stock state", case_id + "/y/z", 7),
                 ("stock state", "stock-only/y/z", 8),
             ]},
        )
示例#20
0
def test_problem_forms():
    with init_db(memory=False) as db:
        db.add_problem_form("abc")

    with init_db(memory=False) as db:
        db.add_problem_form("def")
        eq(set(db.iter_problem_forms()), {"abc", "def"})
示例#21
0
def test_form_linking_multiple_case_types():
    factory = AppFactory(build_version='2.9.0')
    m0, m0f0 = factory.new_basic_module('m0', 'frog')
    factory.form_opens_case(m0f0)

    m1, m1f0 = factory.new_basic_module('m1', 'frog')
    factory.form_requires_case(m1f0)
    m1.search_config.additional_case_types = ['tadpole']

    m0f0.post_form_workflow = WORKFLOW_FORM
    m0f0.form_links = [
        FormLink(form_id=m1f0.unique_id),
    ]

    suite = factory.app.create_suite()
    print(suite.decode('utf8'))

    # ensure that target datum contains both case types
    datum = extract_xml_partial(suite,
                                "./entry[2]/session/datum[@id='case_id']",
                                wrap=False).decode('utf8')
    eq(datum, Regex(r"\[@case_type='frog' or @case_type='tadpole'\]"))

    expected_stack = """
    <partial>
      <create>
        <command value="'m1'"/>
        <datum id="case_id" value="instance('commcaresession')/session/data/case_id_new_frog_0"/>
        <command value="'m1-f0'"/>
      </create>
    </partial>"""
    assert_xml_partial_equal(expected_stack, suite, "./entry[1]/stack/create")
示例#22
0
def test_clone_casediff_data_from_tables():
    from corehq.apps.tzmigration.planning import (
        PlanningForm,
        PlanningCase,
        PlanningCaseAction,
        PlanningStockReportHelper,
    )
    # Any time a model is added to this list it must be analyzed for usage
    # by the case diff process. StateDB.clone_casediff_data_from() may need
    # to be updated.
    eq(
        set(mod.Base.metadata.tables),
        {
            m.__tablename__
            for m in [
                mod.CaseForms,
                mod.CaseToDiff,
                mod.Diff,
                mod.DiffedCase,
                mod.KeyValue,
                mod.DocCount,
                mod.DocDiffs,
                mod.DocChanges,
                mod.MissingDoc,
                mod.NoActionCaseForm,
                mod.PatchedCase,
                mod.ProblemForm,
                # models not used by couch-to-sql migration
                PlanningForm,
                PlanningCase,
                PlanningCaseAction,
                PlanningStockReportHelper,
            ]
        })
示例#23
0
def test_is_request_using_sso_false_with_session():
    """
    Testing the usual case for non-sso requests.
    """
    request = RequestFactory().get('/sso/test')
    generator.create_request_session(request)
    eq(is_request_using_sso(request), False)
示例#24
0
def test_zip_with_gaps_key_funcs():
    """
    Specifying a keyfunc should use it to match items
    """
    WithFirstName = namedtuple('WithFirstName', 'username first_name')
    WithLastName = namedtuple('WithLastName', 'username last_name')

    def get_username(dev):
        return dev.username

    devs = [
        ('Biyeun', 'Buczyk', 'biyeun'),
        ('Cory', 'Zue', 'czue'),
        ('Danny', 'Roberts', 'dannyroberts'),
        ('Jenny', 'Schweers', 'orangejenny'),
        ('Nick', 'Pellegrino', 'nickpell'),
        ('Simon', 'Kelly', 'snopoke'),
    ]
    some_first_names = [
        WithFirstName(u, f) for i, (f, l, u) in enumerate(devs) if i < 4
    ]
    all_last_names = [WithLastName(u, l) for f, l, u in devs]

    zipped = zip_with_gaps(sorted(all_last_names, key=get_username),
                           sorted(some_first_names, key=get_username),
                           all_items_key=get_username,
                           some_items_key=get_username)
    names = [(f.first_name, l.last_name) for l, f in zipped]
    eq(names, [
        ('Biyeun', 'Buczyk'),
        ('Cory', 'Zue'),
        ('Danny', 'Roberts'),
        ('Jenny', 'Schweers'),
    ])
示例#25
0
def test_get_request_data():
    request = RequestFactory().get('/sso/test')
    request.META = {
        'HTTP_HOST': 'test.org',
        'PATH_INFO': '/sso/test',
        'SERVER_PORT': '999',
    }
    request.POST = {
        'post_data': 'test',
    }
    request.GET = {
        'get_data': 'test',
    }
    eq(
        get_request_data(request),
        {
            'https': 'on',
            'http_host': 'test.org',
            'script_name': '/sso/test',
            'server_port': '443',
            'get_data': {
                'get_data': 'test',
            },
            'post_data': {
                'post_data': 'test',
            }
        }
    )
示例#26
0
def test_is_request_using_sso_true():
    """
    Testing the successful criteria for an sso request.
    """
    request = RequestFactory().get('/sso/test')
    generator.create_request_session(request, use_sso=True)
    eq(is_request_using_sso(request), True)
示例#27
0
def test_replace_dead_worker():
    pool = mod.Pool(processes=2)
    with capture_log_output(mod.__name__) as log:
        results = list(pool.imap_unordered(die, range(3)))
    logs = log.get_output()
    eq(logs.count("replaced worker"), 3, logs)
    eq(results, [])
示例#28
0
async def test_redo():
    registry = command.REGISTRY
    server = {"calls": [], "history.get('cmd',)": ["a", "b"]}
    with fake_history(), test_command(with_history=True):
        command.REGISTRY["history"] = registry["history"]
        actual_result = await do_command(server, ["history redo cmd"])
    eq(actual_result, result(value="a"))
示例#29
0
 async def test(command, selection=(0, 0), expect=None):
     if expect is None:
         expect = TEXT
     editor = FakeEditor(__file__, text=TEXT)
     editor.selection = selection
     await do_command(command, editor)
     eq(await editor.get_text(), expect)
示例#30
0
def test_observation_mappings():
    repeater = OpenmrsRepeater.wrap({
        "openmrs_config": {
            "openmrs_provider": "",
            "case_config": {},
            "form_configs": [{
                "xmlns": "http://openrosa.org/formdesigner/9ECA0608-307A-4357-954D-5A79E45C3879",
                "openmrs_encounter_type": "81852aee-3f10-11e4-adec-0800271c1b75",
                "openmrs_visit_type": "c23d6c9d-3f10-11e4-adec-0800271c1b75",
                "openmrs_observations": [
                    {
                        "concept": "397b9631-2911-435a-bf8a-ae4468b9c1d4",
                        "case_property": "abnormal_temperature",
                        "value": {
                            "doc_type": "FormQuestionMap",
                            "form_question": "/data/abnormal_temperature",
                            "value_map": {
                                "yes": "05ced69b-0790-4aad-852f-ba31fe82fbd9",
                                "no": "eea8e4e9-4a91-416c-b0f5-ef0acfbc51c0"
                            },
                        },
                    },
                    {
                        "concept": "397b9631-2911-435a-bf8a-ae4468b9c1d4",
                        "case_property": "bahmni_abnormal_temperature",
                        "value": {
                            "doc_type": "ConstantString",
                            "value": "",
                            "direction": "in",
                        },
                    },
                ]
            }]
        }
    })
    observation_mappings = repeater.observation_mappings
    eq(observation_mappings, {
        '397b9631-2911-435a-bf8a-ae4468b9c1d4': [
            ObservationMapping(
                concept='397b9631-2911-435a-bf8a-ae4468b9c1d4',
                case_property='abnormal_temperature',
                value=FormQuestionMap(
                    form_question='/data/abnormal_temperature',
                    value_map={
                        'yes': '05ced69b-0790-4aad-852f-ba31fe82fbd9',
                        'no': 'eea8e4e9-4a91-416c-b0f5-ef0acfbc51c0'
                    }
                )
            ),
            ObservationMapping(
                concept='397b9631-2911-435a-bf8a-ae4468b9c1d4',
                case_property='bahmni_abnormal_temperature',
                value=ConstantString(
                    direction='in',
                    doc_type='ConstantString',
                    value=''
                )
            )
        ]
    })
def test_iter_15_minute_marks_in_range():
    cases = [
        (
            'a range containing one 15-minute mark should have one mark returned',
            datetime.datetime(2019, 3, 22, 15, 6, 57, 932998),
            datetime.datetime(2019, 3, 22, 15, 16, 23, 978587),
            [
                datetime.datetime(2019, 3, 22, 15, 15, 0, 0),
            ],
        ),
        (
            'a range containing no 15-minute marks should return an empty list',
            datetime.datetime(2019, 3, 22, 15, 6, 57, 932998),
            datetime.datetime(2019, 3, 22, 15, 14, 23, 978587),
            [],
        ),
        (
            'a long range should contain multiple 15-minute marks',
            datetime.datetime(2019, 3, 22, 15, 6, 57, 932998),
            datetime.datetime(2019, 3, 22, 15, 46, 23, 978587),
            [
                datetime.datetime(2019, 3, 22, 15, 15, 0, 0),
                datetime.datetime(2019, 3, 22, 15, 30, 0, 0),
                datetime.datetime(2019, 3, 22, 15, 45, 0, 0),
            ],
        ),
        (
            'with perfectly round start/end times only the start should be inclusive',
            datetime.datetime(2019, 3, 22, 15, 0, 0, 0),
            datetime.datetime(2019, 3, 22, 15, 15, 0, 0),
            [
                datetime.datetime(2019, 3, 22, 15, 0, 0, 0),
            ],
        ),
        (
            """
            if start and end are the same perfectly round time, should contain no marks

            this is because if you have times x < y, and you run (x, x) followed by (x, y),
            x would be contained in the second one, so you don't want it contained in the first
            """,
            datetime.datetime(2019, 3, 22, 15, 0, 0, 0),
            datetime.datetime(2019, 3, 22, 15, 0, 0, 0),
            [],
        ),
        (
            'if start and end are the same non-round time, should contain no marks',
            datetime.datetime(2019, 3, 22, 15, 46, 23, 978587),
            datetime.datetime(2019, 3, 22, 15, 46, 23, 978587),
            [],
        ),
    ]

    for description, start_datetime, end_datetime, expected_output in cases:
        eq(list(_iter_15_minute_marks_in_range(start_datetime, end_datetime)), expected_output,
           description)
示例#32
0
def test_make_buckets_from_timedeltas():
    buckets = [1, 10, 60, 10 * 60, 60 * 60, 12 * 60 * 60, 24 * 60 * 60]
    eq(make_buckets_from_timedeltas(
        timedelta(seconds=1),
        timedelta(seconds=10),
        timedelta(minutes=1),
        timedelta(minutes=10),
        timedelta(hours=1),
        timedelta(hours=12),
        timedelta(hours=24),
    ), buckets)
    eq(DAY_SCALE_TIME_BUCKETS, buckets)
示例#33
0
def test_time_to_start_timer_with_eta():
    task_id = 'abc1234'
    delay = datetime.timedelta(seconds=6)

    start_time = datetime.datetime.utcnow()
    eta = start_time + datetime.timedelta(minutes=5)

    with freeze_time(start_time):
        TimeToStartTimer(task_id).start_timing(eta)

    with freeze_time(eta + delay):
        time_to_start = TimeToStartTimer(task_id).stop_and_pop_timing()

    eq(time_to_start, delay)
示例#34
0
def test_time_to_start_timer():
    task_id = 'abc123'
    delay = datetime.timedelta(seconds=6)

    start_time = datetime.datetime.utcnow()

    # starts empty
    with assert_raises(TimingNotAvailable):
        TimeToStartTimer(task_id).stop_and_pop_timing()

    with freeze_time(start_time):
        TimeToStartTimer(task_id).start_timing(datetime.datetime.utcnow())

    with freeze_time(start_time + delay):
        time_to_start = TimeToStartTimer(task_id).stop_and_pop_timing()

    eq(time_to_start, delay)

    # can only pop once, second time empty
    with assert_raises(TimingNotAvailable):
        TimeToStartTimer(task_id).stop_and_pop_timing()
示例#35
0
def test_tee_output_with_SystemExit():
    fileobj = StringIO()
    with assert_raises(SystemExit), stdfake() as fake, tee_output(fileobj):
        raise SystemExit(1)
    eq(fake.stdout.getvalue(), "")
    eq(fake.stderr.getvalue(), "")
    eq(fileobj.getvalue(), "")
def test_round_datetime_up_to_the_nearest_minute():
    cases = [
        (
            'a normal time should round up',
            datetime.datetime(2019, 3, 22, 15, 6, 57, 932998),
            datetime.datetime(2019, 3, 22, 15, 7, 0, 0),
        ),
        (
            'a perfectly round time should remain unchanged',
            datetime.datetime(2019, 3, 22, 15, 7, 0, 0),
            datetime.datetime(2019, 3, 22, 15, 7, 0, 0),
        ),
        (
            'a second after a perfectly round time should still round up',
            datetime.datetime(2019, 3, 22, 15, 7, 1, 0),
            datetime.datetime(2019, 3, 22, 15, 8, 0, 0),
        ),
        (
            'a second before a perfectly round time should round up',
            datetime.datetime(2019, 3, 22, 15, 8, 59, 0),
            datetime.datetime(2019, 3, 22, 15, 9, 0, 0),
        ),
        (
            'a microsecond after a perfectly round time should still round up',
            datetime.datetime(2019, 3, 22, 15, 7, 0, 1),
            datetime.datetime(2019, 3, 22, 15, 8, 0, 0),
        ),
        (
            'a microsecond before a perfectly round time should round up',
            datetime.datetime(2019, 3, 22, 15, 8, 0, 999999),
            datetime.datetime(2019, 3, 22, 15, 9, 0, 0),
        ),
    ]

    for description, value, expected_output in cases:
        eq(_round_datetime_up_to_the_nearest_minute(value), expected_output, description)
示例#37
0
def test_tee_output_with_KeyboardInterrupt():
    fileobj = StringIO()
    with assert_raises(KeyboardInterrupt), stdfake() as fake, tee_output(fileobj):
        raise KeyboardInterrupt("errrt")
    eq(fake.stdout.getvalue(), "")
    eq(fake.stderr.getvalue(), "")
    eq(sanitize_tb(fileobj.getvalue()),
        "Traceback (most recent call last):\n"
        "  ...\n"
        "KeyboardInterrupt: errrt\n")
示例#38
0
def test_heartbeat():
    hb = Heartbeat('celery_periodic')
    hb.clear_last_seen()

    with assert_raises(HeartbeatNeverRecorded):
        hb.get_last_seen()

    with assert_raises(HeartbeatNeverRecorded):
        hb.get_blockage_duration()

    seen_time = datetime.datetime.utcnow()

    with freeze_time(seen_time):
        hb.mark_seen()
        eq(hb.get_last_seen(), seen_time)
        eq(hb.get_blockage_duration(), datetime.timedelta(seconds=0))

    with freeze_time(seen_time + datetime.timedelta(minutes=10)):
        eq(hb.get_last_seen(), seen_time)
        eq(hb.get_blockage_duration(), datetime.timedelta(minutes=10) - HEARTBEAT_FREQUENCY)
示例#39
0
def test_tee_output():
    fileobj = StringIO()
    with assert_raises(Error), stdfake() as fake, tee_output(fileobj):
        print("testing...")
        sys.stderr.write("fail.\n")
        raise Error("stop")
    eq(fake.stdout.getvalue(), "testing...\n")
    eq(fake.stderr.getvalue(), "fail.\n")
    eq(sanitize_tb(fileobj.getvalue()),
        "testing...\n"
        "fail.\n"
        "Traceback (most recent call last):\n"
        "  ...\n" +
        ("corehq.util.tests.test_teeout.Error" if six.PY3 else "Error") +
        ": stop\n")
示例#40
0
def test_parse_iso8601():
    eq(TimeToStartTimer.parse_iso8601('2009-11-17T12:30:56.527191'),
       datetime.datetime(2009, 11, 17, 12, 30, 56, 527191))