347:9f69026eefb3
Anton Shestakov <av6@dwimlabs.net>, Sun, 12 Apr 2020 23:54:41 +0800
checker: run git with C.UTF-8 instead of en_US.UTF-8 Just in case it makes any difference. C is supposedly more machine-readable.

previous change 160:fda1f8cab608

tests/test_utils.py

Permissions: -rw-r--r--

Other formats: Feeds:
from argparse import Namespace
from datetime import datetime
from candolint.utils import parse_timestamp, timestamp, lookup_option
def test_timestamp_and_parse():
result = parse_timestamp(timestamp())
assert isinstance(result, datetime)
assert result.utcoffset() is None
def test_lookup_option():
lo = lookup_option
assert lo('foo', Namespace(), {}, default='maybe') == 'maybe'
assert lo('foo', Namespace(foo='yes'), {}, default='maybe') == 'yes'
assert lo('foo', Namespace(foo='yes'), {'foo': 'no'}) == 'yes'
assert lo('foo', Namespace(), {'foo': 'no'}, default='maybe') == 'no'
assert lo('a-b-c', Namespace(a_b_c=1), {'a-b-c': 2}, default=3) == 1