Skip to content

Commit

Permalink
Enable validate_all_steps test for all, except some failing drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
kk7ds committed Feb 5, 2025
1 parent 17ad97c commit 6d77ece
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,12 @@ def assertEqualMem(self, a, b, ignore=None):
'Memories have different mem.extra keys')


def requires_feature(flag):
def requires_feature(flag, equal=None):
def inner(fn):
@functools.wraps(fn)
def wraps(self, *a, **k):
if getattr(self.rf, flag):
val = getattr(self.rf, flag)
if (val == equal if equal is not None else val):
fn(self, *a, **k)
else:
self.skipTest('Feature %s not supported' % flag)
Expand Down
47 changes: 47 additions & 0 deletions tests/driver_xfails.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Talkpod_A36plus:
- class: TestCaseBruteForce
test: test_validate_all
reason: Broken name stored in memory 202?
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
BTECH_GMRS-20V2:
- class: TestCaseBruteForce
test: test_validate_all
Expand Down Expand Up @@ -58,3 +61,47 @@ Yaesu_FT-90:
- class: TestCaseBruteForce
test: test_validate_all
reason: Memory 7 stored with high power but unable to be set?
Wouxun_KG-UVD1P:
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
Puxing_PX-2R:
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
Radtel_RT-470X_BT:
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
BTECH_UV-25X4_G2:
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
Abbree_AR-63:
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
Feidaxin_FD-288B:
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
Wouxun_KG-UV8E:
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
Boblov_X3Plus:
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
QYT_KT7900D:
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
BTECH_UV-25X4:
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
Baojie_BJ-9900_Left:
- class: TestCaseBruteForce
test: test_validate_all_steps
reason: Bad channel stored in image or code is wrong
7 changes: 5 additions & 2 deletions tests/test_brute_force.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,15 @@ def test_validate_all(self):
('Radio has validation errors for memory %i '
'stored in sample image') % i)

@pytest.mark.skip(reason='not ready yet')
@base.requires_feature('has_nostep_tuning', equal=False)
def test_validate_all_steps(self):
lo, hi = self.rf.memory_bounds
for i in range(lo, hi + 1):
m1 = self.radio.get_memory(i)
chirp_common.required_step(m1.freq, self.rf.valid_tuning_steps)
try:
chirp_common.required_step(m1.freq, self.rf.valid_tuning_steps)
except Exception as e:
self.fail('Memory %i: %s' % (i, e))

@pytest.mark.skip(reason='not ready yet')
def test_get_set_all(self):
Expand Down

0 comments on commit 6d77ece

Please sign in to comment.