summaryrefslogtreecommitdiff
path: root/tests/unit/test_chirp_common.py
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2025-05-04 23:46:09 +0100
committerDave Hibberd <hibby@debian.org>2025-05-04 23:46:09 +0100
commit812534848086446daa2e57bf2ec8db45e82fea18 (patch)
tree0ab5d2a7c06f656465a648d72e3fbaa0349c5e78 /tests/unit/test_chirp_common.py
parentf6b2e6e7159906b8b3204dca3a9e58e42c36ccbb (diff)
New upstream version 20250502upstream/20250502
Diffstat (limited to 'tests/unit/test_chirp_common.py')
-rw-r--r--tests/unit/test_chirp_common.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/unit/test_chirp_common.py b/tests/unit/test_chirp_common.py
index facdbed..0edce51 100644
--- a/tests/unit/test_chirp_common.py
+++ b/tests/unit/test_chirp_common.py
@@ -504,7 +504,7 @@ class TestStepFunctions(base.BaseTest):
6.25: self._625,
12.5: self._125,
}
- allowed = [6.25, 12.5]
+ allowed = [12.5, 6.25]
for step, freqs in list(steps.items()):
for freq in freqs:
# We don't support 5.0, so any of the frequencies in that
@@ -520,7 +520,7 @@ class TestStepFunctions(base.BaseTest):
def test_required_step_finds_suitable(self):
# If we support 5.0, we should get it as the step for those
self.assertEqual(5.0, chirp_common.required_step(self._005[0],
- allowed=[2.5, 5.0]))
+ allowed=[5.0, 2.5]))
# If we support 2.5 and not 5.0, then we should find 2.5 as a suitable
# alternative
self.assertEqual(2.5, chirp_common.required_step(self._005[0],
@@ -534,7 +534,7 @@ class TestStepFunctions(base.BaseTest):
def test_required_step_fail(self):
self.assertRaises(errors.InvalidDataError,
chirp_common.required_step,
- 146520500)
+ 146520500, allowed=[5.0, 10.0, 12.5])
def test_fix_rounded_step_250(self):
self.assertEqual(146106250,
@@ -548,6 +548,10 @@ class TestStepFunctions(base.BaseTest):
self.assertEqual(146118750,
chirp_common.fix_rounded_step(146118000))
+ def test_fix_rounded_step_no_change(self):
+ self.assertEqual(146520000,
+ chirp_common.fix_rounded_step(146520000))
+
class TestImageMetadata(base.BaseTest):
def test_make_metadata(self):