Close coverage gaps
This commit is contained in:
parent
1ba8303f70
commit
bae19e36d0
3 changed files with 11 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ def parse_timespec( # pylint: disable=unused-argument
|
|||
)
|
||||
if len(value) == 1:
|
||||
return dateutil.parser.parse(value[0])
|
||||
if len(value) == 0: # pragma no cover
|
||||
if len(value) == 0:
|
||||
return datetime.datetime.now(datetime.timezone.utc)
|
||||
raise ValueError("Unexpected number of arguments")
|
||||
except ValueError as e:
|
||||
|
|
|
|||
|
|
@ -211,6 +211,15 @@ WWVB timecode: year=2021 days=340 hour=03 min=40 dst=0 ut1=-100 ly=0 ls=0 --styl
|
|||
"2021-12-6 3:40",
|
||||
)
|
||||
|
||||
def test_now(self) -> None:
|
||||
"""Test outputting timecodes for 'now'"""
|
||||
self.assertModuleOutputStarts(
|
||||
"WWVB timecode: year=",
|
||||
"wwvb.gen",
|
||||
"-m",
|
||||
"1",
|
||||
)
|
||||
|
||||
def test_decode(self) -> None:
|
||||
"""Test the commandline decoder"""
|
||||
self.assertModuleOutput(
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class WWVBTestCase(unittest.TestCase):
|
|||
channel = o[10:]
|
||||
elif o.startswith("--style="):
|
||||
style = o[8:]
|
||||
else: # pragma: no cover
|
||||
else:
|
||||
raise ValueError(f"Unknown option {repr(o)}")
|
||||
num_minutes = len(lines) - 2
|
||||
if channel == "both":
|
||||
|
|
|
|||
Loading…
Reference in a new issue