Merge pull request #155 from jepler/small-tweaks
testwwvb: better(?) alternative
This commit is contained in:
commit
779337f8af
1 changed files with 6 additions and 8 deletions
|
|
@ -14,7 +14,6 @@ import io
|
||||||
import pathlib
|
import pathlib
|
||||||
import random
|
import random
|
||||||
import sys
|
import sys
|
||||||
import typing
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import uwwvb
|
import uwwvb
|
||||||
|
|
@ -48,13 +47,12 @@ class WWVBTestCase(unittest.TestCase):
|
||||||
channel: WWVBChannel = "amplitude"
|
channel: WWVBChannel = "amplitude"
|
||||||
style = "default"
|
style = "default"
|
||||||
for o in options:
|
for o in options:
|
||||||
if o.startswith("--channel="):
|
if o == "--channel=both":
|
||||||
value = o[10:]
|
channel = "both"
|
||||||
if value in {"both", "amplitude", "phase"}:
|
elif o == "--channel=amplitude":
|
||||||
# pyrefly: ignore # redundant-cast
|
channel = "amplitude"
|
||||||
channel = typing.cast("WWVBChannel", value)
|
elif o == "--channel=phase":
|
||||||
else:
|
channel = "phase"
|
||||||
raise ValueError(f"Unknown channel {o!r}")
|
|
||||||
elif o.startswith("--style="):
|
elif o.startswith("--style="):
|
||||||
style = o[8:]
|
style = o[8:]
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue