Example #1
0
def test_fields_tuple_from_dict_returns_cron_field_instances():
    """
    Assert that :func:`~crython.expression._fields_tuple_from_dict` contains
    :class:`~crython.field.CronField` instances.
    """
    fields = expression._fields_tuple_from_dict({})
    assert all(isinstance(f, field.CronField) for f in fields)
Example #2
0
def test_fields_tuple_from_dict_uses_given_field_partials():
    """
    Assert that :func:`~crython.expression._fields_tuple_from_dict` uses the given field_partials dict
    when building the return connection.
    """
    fields = expression._fields_tuple_from_dict({}, field_partials={})
    assert len(fields) == 0
Example #3
0
def test_fields_tuple_from_dict_uses_defaults_on_empty_dict():
    """
    Assert that :func:`~crython.expression._fields_tuple_from_dict` uses all default field values
    when given an empty dict.
    """
    fields = expression._fields_tuple_from_dict({}, field_default='$')
    assert all(f == '$' for f in fields)
Example #4
0
def test_fields_tuple_from_dict_returns_cron_field_instances():
    """
    Assert that :func:`~crython.expression._fields_tuple_from_dict` contains
    :class:`~crython.field.CronField` instances.
    """
    fields = expression._fields_tuple_from_dict({})
    assert all(isinstance(f, field.CronField) for f in fields)
Example #5
0
def test_fields_tuple_from_dict_uses_given_field_partials():
    """
    Assert that :func:`~crython.expression._fields_tuple_from_dict` uses the given field_partials dict
    when building the return connection.
    """
    fields = expression._fields_tuple_from_dict({}, field_partials={})
    assert len(fields) == 0
Example #6
0
def test_fields_tuple_from_dict_uses_defaults_on_empty_dict():
    """
    Assert that :func:`~crython.expression._fields_tuple_from_dict` uses all default field values
    when given an empty dict.
    """
    fields = expression._fields_tuple_from_dict({}, field_default='$')
    assert all(f == '$' for f in fields)