From 6f19923a918f7fb63a444b0c99950fdbe9d2f74c Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Tue, 8 Nov 2022 11:40:39 +0100 Subject: New upstream version 20221106+py3 --- tests/Python3_Driver_Testing.md | 339 ++++++++++++++++++++++++++++ tests/__init__.py | 107 ++++++++- tests/images/Abbree_AR-518.img | Bin 0 -> 2293 bytes tests/images/Abbree_AR-63.img | Bin 0 -> 481 bytes tests/images/AnyTone_5888UV.img | Bin 0 -> 32945 bytes tests/images/AnyTone_5888UVIII.img | Bin 0 -> 32945 bytes tests/images/AnyTone_778UV.img | Bin 0 -> 13121 bytes tests/images/Anysecu_WP-9900.img | Bin 0 -> 16545 bytes tests/images/BTECH_FRS-A1.img | Bin 0 -> 3677 bytes tests/images/BTECH_FRS-B1.img | Bin 0 -> 1173 bytes tests/images/BTECH_GMRS-20V2.img | Bin 0 -> 16549 bytes tests/images/BTECH_GMRS-V2.img | Bin 0 -> 8353 bytes tests/images/Baofeng_BF-T8.img | Bin 0 -> 3081 bytes tests/images/CRT_Micron_UV.img | Bin 0 -> 13121 bytes tests/images/Explorer_QRZ-1.img | Bin 0 -> 9041 bytes tests/images/Kenwood_TM-D710G_CloneMode.img | Bin 0 -> 97721 bytes tests/images/Kenwood_TM-D710_CloneMode.img | Bin 0 -> 40021 bytes tests/images/LUITON_LT-580_UHF.img | Bin 0 -> 16565 bytes tests/images/LUITON_LT-580_VHF.img | Bin 0 -> 16565 bytes tests/images/Lanchonlh_HG-UV98.img | Bin 0 -> 8369 bytes tests/images/Midland_DBR2500.img | Bin 0 -> 13121 bytes tests/images/QYT_KT-8R.img | Bin 0 -> 16537 bytes tests/images/QYT_KT-WP12.img | Bin 0 -> 16549 bytes tests/images/Quansheng_TG-UV2+.img | Bin 0 -> 8417 bytes tests/images/Radioddity_GA-510.img | Bin 0 -> 7345 bytes tests/images/Radioddity_UV-5G.img | Bin 0 -> 6649 bytes tests/images/Retevis_RA85.img | Bin 0 -> 7409 bytes tests/images/Retevis_RB15.img | Bin 0 -> 2113 bytes tests/images/Retevis_RB17.img | Bin 0 -> 1177 bytes tests/images/Retevis_RB17A.img | Bin 0 -> 933 bytes tests/images/Retevis_RB17P.img | Bin 0 -> 6309 bytes tests/images/Retevis_RB17V.img | Bin 0 -> 1173 bytes tests/images/Retevis_RB18.img | Bin 0 -> 1793 bytes tests/images/Retevis_RB19.img | Bin 0 -> 1169 bytes tests/images/Retevis_RB19P.img | Bin 0 -> 1173 bytes tests/images/Retevis_RB23.img | Bin 0 -> 965 bytes tests/images/Retevis_RB26.img | Bin 0 -> 965 bytes tests/images/Retevis_RB27.img | Bin 0 -> 4325 bytes tests/images/Retevis_RB27B.img | Bin 0 -> 4329 bytes tests/images/Retevis_RB27V.img | Bin 0 -> 4329 bytes tests/images/Retevis_RB615.img | Bin 0 -> 2117 bytes tests/images/Retevis_RB617.img | Bin 0 -> 1173 bytes tests/images/Retevis_RB618.img | Bin 0 -> 1797 bytes tests/images/Retevis_RB619.img | Bin 0 -> 1173 bytes tests/images/Retevis_RB627B.img | Bin 0 -> 4329 bytes tests/images/Retevis_RB75.img | Bin 0 -> 1169 bytes tests/images/Retevis_RB85.img | Bin 0 -> 1169 bytes tests/images/Retevis_RT1.img | Bin 0 -> 1024 bytes tests/images/Retevis_RT16.img | Bin 0 -> 3077 bytes tests/images/Retevis_RT19.img | Bin 0 -> 549 bytes tests/images/Retevis_RT22FRS.img | Bin 0 -> 1197 bytes tests/images/Retevis_RT22S.img | Bin 0 -> 1173 bytes tests/images/Retevis_RT29_UHF.img | Bin 0 -> 1197 bytes tests/images/Retevis_RT29_VHF.img | Bin 0 -> 1197 bytes tests/images/Retevis_RT40B.img | Bin 0 -> 517 bytes tests/images/Retevis_RT47.img | Bin 0 -> 1169 bytes tests/images/Retevis_RT47V.img | Bin 0 -> 1173 bytes tests/images/Retevis_RT619.img | Bin 0 -> 445 bytes tests/images/Retevis_RT622.img | Bin 0 -> 1189 bytes tests/images/Retevis_RT647.img | Bin 0 -> 1173 bytes tests/images/Retevis_RT668.img | Bin 0 -> 1173 bytes tests/images/Retevis_RT68.img | Bin 0 -> 1169 bytes tests/images/Retevis_RT76.img | Bin 0 -> 645 bytes tests/images/Retevis_RT87.img | Bin 0 -> 8341 bytes tests/images/Retevis_RT9000D_136-174.img | Bin 0 -> 16569 bytes tests/images/Retevis_RT9000D_220-260.img | Bin 0 -> 16569 bytes tests/images/Retevis_RT9000D_400-490.img | Bin 0 -> 16569 bytes tests/images/Retevis_RT9000D_66-88.img | Bin 0 -> 16569 bytes tests/images/Retevis_RT95.img | Bin 0 -> 13121 bytes tests/images/Rugged_RH5R-V2.img | Bin 0 -> 8360 bytes tests/images/TYT_TH-UV88.img | Bin 0 -> 9029 bytes tests/images/Vertex_Standard_FTL-2011.img | Bin 0 -> 589 bytes tests/images/Wouxun_KG-935G.img | Bin 0 -> 32937 bytes tests/images/Wouxun_KG-UV920P-A.img | Bin 0 -> 26345 bytes tests/images/Yaesu_FTM-7250D_R.img | Bin 0 -> 65400 bytes tests/py3_driver_testers.txt | 41 ++++ tests/py3_remaining.txt | 17 ++ tests/run_tests.py | 13 +- tests/unit/base.py | 9 + tests/unit/test_directory.py | 25 ++ tests/unit/test_memedit_edits.py | 18 +- tests/unit/test_settings.py | 24 ++ tests/unit/test_shiftdialog.py | 17 +- tests/unit/test_wxui_radiothread.py | 105 +++++++++ 84 files changed, 680 insertions(+), 35 deletions(-) create mode 100644 tests/Python3_Driver_Testing.md create mode 100644 tests/images/Abbree_AR-518.img create mode 100644 tests/images/Abbree_AR-63.img create mode 100644 tests/images/AnyTone_5888UV.img create mode 100644 tests/images/AnyTone_5888UVIII.img create mode 100644 tests/images/AnyTone_778UV.img create mode 100644 tests/images/Anysecu_WP-9900.img create mode 100644 tests/images/BTECH_FRS-A1.img create mode 100644 tests/images/BTECH_FRS-B1.img create mode 100644 tests/images/BTECH_GMRS-20V2.img create mode 100644 tests/images/BTECH_GMRS-V2.img create mode 100644 tests/images/Baofeng_BF-T8.img create mode 100644 tests/images/CRT_Micron_UV.img create mode 100644 tests/images/Explorer_QRZ-1.img create mode 100644 tests/images/Kenwood_TM-D710G_CloneMode.img create mode 100644 tests/images/Kenwood_TM-D710_CloneMode.img create mode 100644 tests/images/LUITON_LT-580_UHF.img create mode 100644 tests/images/LUITON_LT-580_VHF.img create mode 100644 tests/images/Lanchonlh_HG-UV98.img create mode 100644 tests/images/Midland_DBR2500.img create mode 100644 tests/images/QYT_KT-8R.img create mode 100644 tests/images/QYT_KT-WP12.img create mode 100644 tests/images/Quansheng_TG-UV2+.img create mode 100644 tests/images/Radioddity_GA-510.img create mode 100644 tests/images/Radioddity_UV-5G.img create mode 100644 tests/images/Retevis_RA85.img create mode 100644 tests/images/Retevis_RB15.img create mode 100644 tests/images/Retevis_RB17.img create mode 100644 tests/images/Retevis_RB17A.img create mode 100644 tests/images/Retevis_RB17P.img create mode 100644 tests/images/Retevis_RB17V.img create mode 100644 tests/images/Retevis_RB18.img create mode 100644 tests/images/Retevis_RB19.img create mode 100644 tests/images/Retevis_RB19P.img create mode 100644 tests/images/Retevis_RB23.img create mode 100644 tests/images/Retevis_RB26.img create mode 100644 tests/images/Retevis_RB27.img create mode 100644 tests/images/Retevis_RB27B.img create mode 100644 tests/images/Retevis_RB27V.img create mode 100644 tests/images/Retevis_RB615.img create mode 100644 tests/images/Retevis_RB617.img create mode 100644 tests/images/Retevis_RB618.img create mode 100644 tests/images/Retevis_RB619.img create mode 100644 tests/images/Retevis_RB627B.img create mode 100644 tests/images/Retevis_RB75.img create mode 100644 tests/images/Retevis_RB85.img create mode 100644 tests/images/Retevis_RT1.img create mode 100644 tests/images/Retevis_RT16.img create mode 100644 tests/images/Retevis_RT19.img create mode 100644 tests/images/Retevis_RT22FRS.img create mode 100644 tests/images/Retevis_RT22S.img create mode 100644 tests/images/Retevis_RT29_UHF.img create mode 100644 tests/images/Retevis_RT29_VHF.img create mode 100644 tests/images/Retevis_RT40B.img create mode 100644 tests/images/Retevis_RT47.img create mode 100644 tests/images/Retevis_RT47V.img create mode 100644 tests/images/Retevis_RT619.img create mode 100644 tests/images/Retevis_RT622.img create mode 100644 tests/images/Retevis_RT647.img create mode 100644 tests/images/Retevis_RT668.img create mode 100644 tests/images/Retevis_RT68.img create mode 100644 tests/images/Retevis_RT76.img create mode 100644 tests/images/Retevis_RT87.img create mode 100644 tests/images/Retevis_RT9000D_136-174.img create mode 100644 tests/images/Retevis_RT9000D_220-260.img create mode 100644 tests/images/Retevis_RT9000D_400-490.img create mode 100644 tests/images/Retevis_RT9000D_66-88.img create mode 100644 tests/images/Retevis_RT95.img create mode 100644 tests/images/Rugged_RH5R-V2.img create mode 100644 tests/images/TYT_TH-UV88.img create mode 100644 tests/images/Vertex_Standard_FTL-2011.img create mode 100644 tests/images/Wouxun_KG-935G.img create mode 100644 tests/images/Wouxun_KG-UV920P-A.img create mode 100755 tests/images/Yaesu_FTM-7250D_R.img create mode 100644 tests/py3_driver_testers.txt create mode 100644 tests/py3_remaining.txt create mode 100644 tests/unit/test_wxui_radiothread.py (limited to 'tests') diff --git a/tests/Python3_Driver_Testing.md b/tests/Python3_Driver_Testing.md new file mode 100644 index 0000000..ccb0d49 --- /dev/null +++ b/tests/Python3_Driver_Testing.md @@ -0,0 +1,339 @@ +## Status +| Driver | Tester | Tested | Byte Clean | +| ------ | ------ | ------ | ---------- | +| ARRL_Travel_Plus | | | | +| Abbree_AR-518 | | | | +| Abbree_AR-63 | | | | +| Alinco_DJ-G7EG | | | | +| Alinco_DJ175 | | | | +| Alinco_DJ596 | | | | +| Alinco_DR03T | | | | +| Alinco_DR06T | | | | +| Alinco_DR135T | | | | +| Alinco_DR235T | | | | +| Alinco_DR435T | | | | +| AnyTone_5888UV | | | | +| AnyTone_5888UVIII | | | | +| AnyTone_778UV | | | Yes | +| AnyTone_778UV_VOX | | | Yes | +| AnyTone_OBLTR-8R | | | | +| AnyTone_TERMN-8R | | | | +| Anysecu_WP-9900 | | | Yes | +| BTECH_FRS-A1 | | | | +| BTECH_FRS-B1 | | | | +| BTECH_GMRS-20V2 | | | Yes | +| BTECH_GMRS-50X1 | | | Yes | +| BTECH_GMRS-V1 | | | | +| BTECH_GMRS-V2 | | | | +| BTECH_MURS-V1 | | | | +| BTECH_UV-2501 | | | Yes | +| BTECH_UV-2501+220 | | | Yes | +| BTECH_UV-25X2 | | | Yes | +| BTECH_UV-25X4 | | | Yes | +| BTECH_UV-5001 | | | Yes | +| BTECH_UV-50X2 | | | Yes | +| BTECH_UV-50X3 | | | | +| BTECH_UV-5X3 | | | | +| Baofeng_BF-888 | [@kk7ds](https://github.com/kk7ds) | 13-Feb-2019 | Yes | +| Baofeng_BF-A58 | | | | +| Baofeng_BF-A58S | | | | +| Baofeng_BF-F8HP | | | Yes | +| Baofeng_BF-T1 | | | | +| Baofeng_BF-T8 | | | | +| Baofeng_BF-V8A | | | | +| Baofeng_F-11 | | | Yes | +| Baofeng_GT-3WP | | | | +| Baofeng_GT-5R | | | Yes | +| Baofeng_UV-3R | [@yarda](https://github.com/yarda) | 26-Sep-2022 | | +| Baofeng_UV-5R | [@lekv](https://github.com/lekv) | 23-Oct-2022 | Yes | +| Baofeng_UV-6 | | | Yes | +| Baofeng_UV-6R | | | | +| Baofeng_UV-82 | | | Yes | +| Baofeng_UV-82HP | | | Yes | +| Baofeng_UV-82WP | | | | +| Baofeng_UV-9G | | | | +| Baofeng_UV-9R | | | | +| Baofeng_UV-B5 | | | Yes | +| Baojie_BJ-UV55 | | | Yes | +| Boblov_X3Plus | | | | +| CRT_Micron_UV | | | Yes | +| CRT_Micron_UV_V2 | | | Yes | +| Commander_KG-UV | | | | +| Explorer_QRZ-1 | | | | +| Feidaxin_FD-150A | | | | +| Feidaxin_FD-160A | | | | +| Feidaxin_FD-268A | | | | +| Feidaxin_FD-268B | | | | +| Feidaxin_FD-288A | | | | +| Feidaxin_FD-288B | | | | +| Feidaxin_FD-450A | | | | +| Feidaxin_FD-460A | | | | +| Feidaxin_FD-460UH | | | | +| Generic_CSV | | | | +| HobbyPCB_RS-UV3 | | | | +| Icom_746 | | | Yes | +| Icom_IC-208H | | | Yes | +| Icom_IC-2100H | | | Yes | +| Icom_IC-2200H | [@kk7ds](https://github.com/kk7ds) | 24-Oct-2022 | Yes | +| Icom_IC-2300H | | | Yes | +| Icom_IC-2720H | | | Yes | +| Icom_IC-2730A | | | Yes | +| Icom_IC-2820H | [@kk7ds](https://github.com/kk7ds) | 22-Oct-2022 | Yes | +| Icom_IC-7000 | | | Yes | +| Icom_IC-7100 | | | Yes | +| Icom_IC-7200 | [@kk7ds](https://github.com/kk7ds) | 22-Oct-2022 | Yes | +| Icom_IC-7300 | [@kk7ds](https://github.com/kk7ds) | 22-Oct-2022 | Yes | +| Icom_IC-7610 | [@kk7ds](https://github.com/kk7ds) | 24-Oct-2022 | Yes | +| Icom_IC-910 | [@mfncooper](https://github.com/mfncooper) | 1-Oct-2021 | Yes | +| Icom_IC-91_92AD | | | | +| Icom_IC-E90 | | | Yes | +| Icom_IC-P7 | | | Yes | +| Icom_IC-Q7A | | | Yes | +| Icom_IC-T70 | | | Yes | +| Icom_IC-T7H | | | Yes | +| Icom_IC-T8A | | | Yes | +| Icom_IC-V82_U82 | | | | +| Icom_IC-V86 | | | Yes | +| Icom_IC-W32A | | | Yes | +| Icom_IC-W32E | | | Yes | +| Icom_ID-31A | [@kk7ds](https://github.com/kk7ds) | 12-Feb-2019 | Yes | +| Icom_ID-51 | | | Yes | +| Icom_ID-51_Plus | | | Yes | +| Icom_ID-800H_v2 | [@kk7ds](https://github.com/kk7ds) | 22-Oct-2022 | Yes | +| Icom_ID-80H | | | Yes | +| Icom_ID-880H | [@kk7ds](https://github.com/kk7ds) | 22-Oct-2022 | Yes | +| Intek_HR-2040 | | | | +| Intek_KT-980HP | | | Yes | +| Jetstream_JT220M | | | | +| Jetstream_JT270M | | | | +| Jetstream_JT270MH | | | | +| KYD_IP-620 | | | | +| KYD_NC-630A | | | | +| Kenwood_HMK | | | | +| Kenwood_ITM | | | | +| Kenwood_TH-D7 | | | Yes | +| Kenwood_TH-D72_clone_mode | | | | +| Kenwood_TH-D72_live_mode | [@kk7ds](https://github.com/kk7ds) | 21-Oct-2022 | Yes | +| Kenwood_TH-D74_live_mode | [@kk7ds](https://github.com/kk7ds) | 20-Oct-2022 | Yes | +| Kenwood_TH-D7G | | | Yes | +| Kenwood_TH-F6 | | | Yes | +| Kenwood_TH-F7 | [@sv1](https://github.com/sv1) | 19-Oct-2022 | Yes | +| Kenwood_TH-G71 | | | Yes | +| Kenwood_TH-K2 | | | Yes | +| Kenwood_TK-2180 | | | Yes | +| Kenwood_TK-260 | | | | +| Kenwood_TK-260G | | | | +| Kenwood_TK-270 | | | | +| Kenwood_TK-270G | | | | +| Kenwood_TK-272 | | | | +| Kenwood_TK-272G | | | | +| Kenwood_TK-278 | | | | +| Kenwood_TK-278G | | | | +| Kenwood_TK-3180K | | | Yes | +| Kenwood_TK-3180K2 | | | Yes | +| Kenwood_TK-360 | | | | +| Kenwood_TK-360G | | | | +| Kenwood_TK-370 | | | | +| Kenwood_TK-370G | | | | +| Kenwood_TK-372 | | | | +| Kenwood_TK-372G | | | | +| Kenwood_TK-378 | | | | +| Kenwood_TK-378G | | | | +| Kenwood_TK-388G | | | | +| Kenwood_TK-7102 | [@kk7ds](https://github.com/kk7ds) | 15-Feb-2019 | Yes | +| Kenwood_TK-7108 | [@kk7ds](https://github.com/kk7ds) | 15-Feb-2019 | Yes | +| Kenwood_TK-7180 | [@kk7ds](https://github.com/kk7ds) | 18-Oct-2022 | Yes | +| Kenwood_TK-7180E | | | Yes | +| Kenwood_TK-760 | | | | +| Kenwood_TK-760G | | | | +| Kenwood_TK-762 | | | | +| Kenwood_TK-762G | | | | +| Kenwood_TK-768 | | | | +| Kenwood_TK-768G | | | | +| Kenwood_TK-8102 | [@kk7ds](https://github.com/kk7ds) | 15-Feb-2019 | Yes | +| Kenwood_TK-8108 | [@kk7ds](https://github.com/kk7ds) | 15-Feb-2019 | Yes | +| Kenwood_TK-8180 | [@kk7ds](https://github.com/kk7ds) | 18-Oct-2022 | Yes | +| Kenwood_TK-8180E | | | Yes | +| Kenwood_TK-860 | | | | +| Kenwood_TK-860G | | | | +| Kenwood_TK-862 | | | | +| Kenwood_TK-862G | | | | +| Kenwood_TK-868 | | | | +| Kenwood_TK-868G | | | | +| Kenwood_TM-271 | [Implied by Kenwood_TM-281](#user-content-Kenwood_TM-281) | 23-Oct-2022 | Yes | +| Kenwood_TM-281 | [@kk7ds](https://github.com/kk7ds) | 23-Oct-2022 | Yes | +| Kenwood_TM-471 | | | Yes | +| Kenwood_TM-D700 | [@kk7ds](https://github.com/kk7ds) | 20-Oct-2022 | Yes | +| Kenwood_TM-D710 | | | Yes | +| Kenwood_TM-D710G | [@kk7ds](https://github.com/kk7ds) | 22-Oct-2022 | Yes | +| Kenwood_TM-D710G_CloneMode | [@kk7ds](https://github.com/kk7ds) | 22-Oct-2022 | Yes | +| Kenwood_TM-D710_CloneMode | | | Yes | +| Kenwood_TM-G707 | | | Yes | +| Kenwood_TM-V7 | | | Yes | +| Kenwood_TM-V71 | [@kk7ds](https://github.com/kk7ds) | 21-Oct-2022 | Yes | +| Kenwood_TS-2000 | | | Yes | +| Kenwood_TS-480_CloneMode | | | | +| Kenwood_TS-480_LiveMode | | | Yes | +| Kenwood_TS-590SG_CloneMode | | | | +| Kenwood_TS-590S_CloneMode | | | | +| Kenwood_TS-590S_SG_LiveMode | | | Yes | +| Kenwood_TS-850 | | | Yes | +| LUITON_LT-316 | | | | +| LUITON_LT-580_UHF | | | | +| LUITON_LT-580_VHF | | | | +| LUITON_LT-588UV | | | Yes | +| Lanchonlh_HG-UV98 | | | Yes | +| Leixen_VV-898 | | | | +| Leixen_VV-898S | | | | +| MTC_UV-5R-3 | | | | +| Midland_DBR2500 | | | Yes | +| Polmar_DB-50M | | | | +| Powerwerx_DB-750X | | | | +| QYT_KT-8R | | | Yes | +| QYT_KT-UV980 | | | Yes | +| QYT_KT-WP12 | | | Yes | +| QYT_KT5800 | | | Yes | +| QYT_KT7900D | | | Yes | +| QYT_KT8900 | | | Yes | +| QYT_KT8900D | | | Yes | +| QYT_KT8900R | | | Yes | +| QYT_KT980PLUS | | | Yes | +| Quansheng_TG-UV2+ | | | | +| RT_Systems_CSV | | | | +| Radioddity_DB25-G | | | Yes | +| Radioddity_GA-2S | | | Yes | +| Radioddity_GA-510 | [@kk7ds](https://github.com/kk7ds) | 21-Oct-2022 | Yes | +| Radioddity_R2 | | | | +| Radioddity_UV-5G | | | Yes | +| Radioddity_UV-5RX3 | | | Yes | +| Radioddity_UV-82X3 | | | Yes | +| Radtel_T18 | | | | +| Retevis_H777_Plus | | | Yes | +| Retevis_RA685 | | | Yes | +| Retevis_RA85 | | | Yes | +| Retevis_RB15 | | | | +| Retevis_RB17 | | | | +| Retevis_RB17A | | | | +| Retevis_RB17P | | | | +| Retevis_RB17V | | | | +| Retevis_RB18 | | | | +| Retevis_RB19 | | | | +| Retevis_RB19P | | | | +| Retevis_RB23 | | | | +| Retevis_RB26 | | | | +| Retevis_RB27 | | | | +| Retevis_RB27B | | | | +| Retevis_RB27V | | | | +| Retevis_RB615 | | | | +| Retevis_RB617 | | | | +| Retevis_RB618 | | | | +| Retevis_RB619 | | | | +| Retevis_RB627B | | | | +| Retevis_RB75 | | | | +| Retevis_RB85 | | | | +| Retevis_RT1 | | | | +| Retevis_RT16 | | | | +| Retevis_RT19 | | | | +| Retevis_RT21 | | | | +| Retevis_RT22 | | | | +| Retevis_RT22FRS | | | | +| Retevis_RT22S | | | | +| Retevis_RT23 | | | | +| Retevis_RT26 | | | | +| Retevis_RT29_UHF | | | | +| Retevis_RT29_VHF | | | | +| Retevis_RT40B | | | | +| Retevis_RT47 | | | | +| Retevis_RT47V | | | | +| Retevis_RT6 | | | | +| Retevis_RT619 | | | | +| Retevis_RT622 | | | | +| Retevis_RT647 | | | | +| Retevis_RT668 | | | | +| Retevis_RT68 | | | | +| Retevis_RT76 | | | | +| Retevis_RT76P | | | | +| Retevis_RT85 | | | | +| Retevis_RT87 | | | | +| Retevis_RT9000D_136-174 | | | | +| Retevis_RT9000D_220-260 | | | | +| Retevis_RT9000D_400-490 | | | | +| Retevis_RT9000D_66-88 | | | | +| Retevis_RT95 | | | Yes | +| Retevis_RT95_VOX | | | Yes | +| Retevis_RT98 | | | | +| Rugged_RH5R-V2 | | | | +| TDXone_TD-Q8A | | | | +| TIDRADIO_TD-H6 | [@kk7ds](https://github.com/kk7ds) | 21-Oct-2022 | Yes | +| TID_TD-M8 | | | | +| TYT_TH-350 | | | Yes | +| TYT_TH-7800 | | | | +| TYT_TH-7800_File | | | | +| TYT_TH-9800 | | | | +| TYT_TH-9800_File | | | | +| TYT_TH-UV8000 | | | | +| TYT_TH-UV88 | | | | +| TYT_TH-UVF1 | | | | +| TYT_TH-UVF8D | | | | +| TYT_TH9000_144 | | | | +| TYT_TH9000_220 | | | | +| TYT_TH9000_440 | | | | +| Vertex_Standard_FTL-1011 | | | | +| Vertex_Standard_FTL-2011 | | | | +| Vertex_Standard_FTL-7011 | | | | +| Vertex_Standard_FTL-8011 | | | | +| Vertex_Standard_VXA-700 | | | | +| WACCOM_MINI-8900 | | | Yes | +| WLN_KD-C1 | | | | +| Wouxun_KG-935G | | | | +| Wouxun_KG-UV8D | | | | +| Wouxun_KG-UV8D_Plus | | | | +| Wouxun_KG-UV8E | | | | +| Wouxun_KG-UV920P-A | | | | +| Wouxun_KG-UV9D_Plus | | | | +| Yaesu_FT-1500M | | | Yes | +| Yaesu_FT-1802M | | | Yes | +| Yaesu_FT-25R | | | Yes | +| Yaesu_FT-2800M | | | Yes | +| Yaesu_FT-2900R_1900R | | | Yes | +| Yaesu_FT-2900R_1900RTXMod_Opened_Xmit | | | Yes | +| Yaesu_FT-4VR | | | Yes | +| Yaesu_FT-4XE | | | Yes | +| Yaesu_FT-4XR | | | Yes | +| Yaesu_FT-50 | | | Yes | +| Yaesu_FT-60 | | | Yes | +| Yaesu_FT-65E | | | Yes | +| Yaesu_FT-65R | | | Yes | +| Yaesu_FT-70D | | | Yes | +| Yaesu_FT-7100M | | | Yes | +| Yaesu_FT-7800_7900 | [@kk7ds](https://github.com/kk7ds) | 24-Oct-2022 | Yes | +| Yaesu_FT-8100 | | | Yes | +| Yaesu_FT-817 | [@kk7ds](https://github.com/kk7ds) | 14-Feb-2019 | Yes | +| Yaesu_FT-817ND | | | Yes | +| Yaesu_FT-817ND_US | | | Yes | +| Yaesu_FT-818 | | | Yes | +| Yaesu_FT-818ND_US | | | Yes | +| Yaesu_FT-857_897 | | | Yes | +| Yaesu_FT-857_897_US | | | Yes | +| Yaesu_FT-8800 | [@kk7ds](https://github.com/kk7ds) | 24-Oct-2022 | Yes | +| Yaesu_FT-8900 | | | Yes | +| Yaesu_FT-90 | | | Yes | +| Yaesu_FTM-350 | | | Yes | +| Yaesu_VX-170 | | | Yes | +| Yaesu_VX-2 | | | Yes | +| Yaesu_VX-3 | [@kk7ds](https://github.com/kk7ds) | 15-Feb-2019 | Yes | +| Yaesu_VX-5 | | | Yes | +| Yaesu_VX-6 | | | Yes | +| Yaesu_VX-7 | [@kk7ds](https://github.com/kk7ds) | 15-Feb-2019 | Yes | +| Yaesu_VX-8DR | [@kk7ds](https://github.com/kk7ds) | 15-Feb-2019 | Yes | +| Yaesu_VX-8GE | | | Yes | +| Yaesu_VX-8R | | | Yes | +| Yedro_YC-M04VUS | | | Yes | +| Zastone_ZT-X6 | | | | +## Stats + +**Drivers:** 329 + +**Tested:** 10% (35/294) + +**Byte clean:** 45% (151/178) diff --git a/tests/__init__.py b/tests/__init__.py index d04e516..7fc393e 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,3 +1,4 @@ +import functools import glob import logging import os @@ -7,6 +8,7 @@ import sys import tempfile import unittest +import pytest import six from chirp import directory @@ -15,6 +17,24 @@ from tests import run_tests LOG = logging.getLogger('testadapter') +PY3_XFAIL = [] + + +def if_enabled(fn): + name = fn.__name__.replace('test_', '') + if 'CHIRP_TESTS' in os.environ: + tests_enabled = os.environ['CHIRP_TESTS'].split(',') + enabled = name in tests_enabled + else: + enabled = True + + def wrapper(*a, **k): + if enabled: + return fn(*a, **k) + else: + raise unittest.SkipTest('%s not enabled' % name) + + return wrapper class TestAdapterMeta(type): @@ -27,6 +47,7 @@ class TestAdapter(unittest.TestCase): SOURCE_IMAGE = None RADIO_INST = None testwrapper = None + XFAIL = False def shortDescription(self): test = self.id().split('.')[-1].replace('test_', '').replace('_', ' ') @@ -48,6 +69,17 @@ class TestAdapter(unittest.TestCase): def tearDownClass(cls): os.remove(cls.testimage) + def setUp(self): + self._out = run_tests.TestOutputANSI() + rid = "%s_%s_" % (self.RADIO_CLASS.VENDOR, self.RADIO_CLASS.MODEL) + rid = rid.replace("/", "_") + basefn, ext = os.path.splitext(self.testimage) + self.testimage = tempfile.mktemp('.%s' % ext, rid) + shutil.copy(self.SOURCE_IMAGE, self.testimage) + + def tearDown(self): + os.remove(self.testimage) + def _runtest(self, test): tw = run_tests.TestWrapper(self.RADIO_CLASS, self.testimage, @@ -65,27 +97,37 @@ class TestAdapter(unittest.TestCase): finally: testcase.cleanup() + @if_enabled def test_copy_all(self): self._runtest(run_tests.TestCaseCopyAll) + @if_enabled def test_brute_force(self): self._runtest(run_tests.TestCaseBruteForce) + @if_enabled def test_edges(self): self._runtest(run_tests.TestCaseEdges) + @if_enabled def test_settings(self): self._runtest(run_tests.TestCaseSettings) + @if_enabled def test_banks(self): self._runtest(run_tests.TestCaseBanks) + @if_enabled def test_detect(self): self._runtest(run_tests.TestCaseDetect) + @if_enabled def test_clone(self): self._runtest(run_tests.TestCaseClone) + def test_py3_expected(self): + assert self.SOURCE_IMAGE not in PY3_XFAIL + def _get_sub_devices(rclass, testimage): try: @@ -93,22 +135,43 @@ def _get_sub_devices(rclass, testimage): except Exception as e: tw = run_tests.TestWrapper(rclass, testimage) - rf = tw.do("get_features") + try: + rf = tw.do("get_features") + except Exception as e: + print('Failed to get features for %s: %s' % (rclass, e)) + # FIXME: If the driver fails to run get_features with no memobj + # we should not arrest the test load. This appears to happen for + # the Puxing777 for some reason, and not all the time. Figure that + # out, but until then, assume crash means "no sub devices". + return [rclass] if rf.has_sub_devices: return tw.do("get_sub_devices") else: return [rclass] +class TestAdapterXFAIL(TestAdapter): + @pytest.mark.xfail(reason=('Driver not expected to run in python3. ' + 'Remove from py3_remaining.txt'), strict=True) + def test_py3_expected(self): + pass + + class RadioSkipper(unittest.TestCase): def test_is_supported_by_environment(self): raise unittest.SkipTest('Running in py3 and driver is not supported') -def load_tests(loader, tests, pattern, suite=None): +def _load_tests(loader, tests, pattern, suite=None): if not suite: suite = unittest.TestSuite() + if 'CHIRP_TESTIMG' in os.environ: + images = os.environ['CHIRP_TESTIMG'].split() + else: + images = glob.glob("tests/images/*.img") + tests = [os.path.splitext(os.path.basename(img))[0] for img in images] + base = os.path.dirname(os.path.abspath(__file__)) base = os.path.join(base, 'images') images = glob.glob(os.path.join(base, "*")) @@ -118,13 +181,29 @@ def load_tests(loader, tests, pattern, suite=None): # This default is meaningless for us pattern = None + py3_remaining = [x.strip() for x in open(os.path.join( + base, '..', 'py3_remaining.txt')).readlines() + if not x.startswith('#')] + for image, test in tests.items(): try: rclass = directory.get_radio(test) + if os.path.basename(image) in py3_remaining: + PY3_XFAIL.append(image) + except Exception: - if six.PY3 and 'CHIRP_DEBUG' in os.environ: + if not six.PY3: + raise + + if 'CHIRP_DEBUG' in os.environ: LOG.error('Failed to load %s' % test) + + if os.path.basename(image) in py3_remaining: + # We expect this to fail to import in py3, so do not + # abort the test run. continue + print('%s not in py3 exclusion list %s...' % ( + os.path.basename(image), ','.join(py3_remaining))) raise for device in _get_sub_devices(rclass, image): class_name = 'TestCase_%s' % ( @@ -135,10 +214,16 @@ def load_tests(loader, tests, pattern, suite=None): else: dst = device device = device.__class__ + + if image in PY3_XFAIL: + cls = TestAdapterXFAIL + else: + cls = TestAdapter + tc = TestAdapterMeta( - class_name, (TestAdapter,), dict(RADIO_CLASS=device, - SOURCE_IMAGE=image, - RADIO_INST=dst)) + class_name, (cls,), dict(RADIO_CLASS=device, + SOURCE_IMAGE=image, + RADIO_INST=dst)) tests = loader.loadTestsFromTestCase(tc) if pattern: @@ -149,3 +234,13 @@ def load_tests(loader, tests, pattern, suite=None): suite.addTests(tests) return suite + + +def load_tests(loader, tests, pattern, suite=None): + try: + return _load_tests(loader, tests, pattern, suite=suite) + except Exception as e: + import traceback + print('Failed to load: %s' % e) + print(traceback.format_exc()) + raise diff --git a/tests/images/Abbree_AR-518.img b/tests/images/Abbree_AR-518.img new file mode 100644 index 0000000..c40e4a4 Binary files /dev/null and b/tests/images/Abbree_AR-518.img differ diff --git a/tests/images/Abbree_AR-63.img b/tests/images/Abbree_AR-63.img new file mode 100644 index 0000000..5edcccf Binary files /dev/null and b/tests/images/Abbree_AR-63.img differ diff --git a/tests/images/AnyTone_5888UV.img b/tests/images/AnyTone_5888UV.img new file mode 100644 index 0000000..9f0e7df Binary files /dev/null and b/tests/images/AnyTone_5888UV.img differ diff --git a/tests/images/AnyTone_5888UVIII.img b/tests/images/AnyTone_5888UVIII.img new file mode 100644 index 0000000..17e9676 Binary files /dev/null and b/tests/images/AnyTone_5888UVIII.img differ diff --git a/tests/images/AnyTone_778UV.img b/tests/images/AnyTone_778UV.img new file mode 100644 index 0000000..e1f2f65 Binary files /dev/null and b/tests/images/AnyTone_778UV.img differ diff --git a/tests/images/Anysecu_WP-9900.img b/tests/images/Anysecu_WP-9900.img new file mode 100644 index 0000000..6ca11c1 Binary files /dev/null and b/tests/images/Anysecu_WP-9900.img differ diff --git a/tests/images/BTECH_FRS-A1.img b/tests/images/BTECH_FRS-A1.img new file mode 100644 index 0000000..549f946 Binary files /dev/null and b/tests/images/BTECH_FRS-A1.img differ diff --git a/tests/images/BTECH_FRS-B1.img b/tests/images/BTECH_FRS-B1.img new file mode 100644 index 0000000..565ea0c Binary files /dev/null and b/tests/images/BTECH_FRS-B1.img differ diff --git a/tests/images/BTECH_GMRS-20V2.img b/tests/images/BTECH_GMRS-20V2.img new file mode 100644 index 0000000..8a53729 Binary files /dev/null and b/tests/images/BTECH_GMRS-20V2.img differ diff --git a/tests/images/BTECH_GMRS-V2.img b/tests/images/BTECH_GMRS-V2.img new file mode 100644 index 0000000..8c05c4f Binary files /dev/null and b/tests/images/BTECH_GMRS-V2.img differ diff --git a/tests/images/Baofeng_BF-T8.img b/tests/images/Baofeng_BF-T8.img new file mode 100644 index 0000000..f948048 Binary files /dev/null and b/tests/images/Baofeng_BF-T8.img differ diff --git a/tests/images/CRT_Micron_UV.img b/tests/images/CRT_Micron_UV.img new file mode 100644 index 0000000..e1f2f65 Binary files /dev/null and b/tests/images/CRT_Micron_UV.img differ diff --git a/tests/images/Explorer_QRZ-1.img b/tests/images/Explorer_QRZ-1.img new file mode 100644 index 0000000..a53beb9 Binary files /dev/null and b/tests/images/Explorer_QRZ-1.img differ diff --git a/tests/images/Kenwood_TM-D710G_CloneMode.img b/tests/images/Kenwood_TM-D710G_CloneMode.img new file mode 100644 index 0000000..2324564 Binary files /dev/null and b/tests/images/Kenwood_TM-D710G_CloneMode.img differ diff --git a/tests/images/Kenwood_TM-D710_CloneMode.img b/tests/images/Kenwood_TM-D710_CloneMode.img new file mode 100644 index 0000000..83d84ed Binary files /dev/null and b/tests/images/Kenwood_TM-D710_CloneMode.img differ diff --git a/tests/images/LUITON_LT-580_UHF.img b/tests/images/LUITON_LT-580_UHF.img new file mode 100644 index 0000000..7b03472 Binary files /dev/null and b/tests/images/LUITON_LT-580_UHF.img differ diff --git a/tests/images/LUITON_LT-580_VHF.img b/tests/images/LUITON_LT-580_VHF.img new file mode 100644 index 0000000..6795db5 Binary files /dev/null and b/tests/images/LUITON_LT-580_VHF.img differ diff --git a/tests/images/Lanchonlh_HG-UV98.img b/tests/images/Lanchonlh_HG-UV98.img new file mode 100644 index 0000000..ab20bb1 Binary files /dev/null and b/tests/images/Lanchonlh_HG-UV98.img differ diff --git a/tests/images/Midland_DBR2500.img b/tests/images/Midland_DBR2500.img new file mode 100644 index 0000000..e1f2f65 Binary files /dev/null and b/tests/images/Midland_DBR2500.img differ diff --git a/tests/images/QYT_KT-8R.img b/tests/images/QYT_KT-8R.img new file mode 100644 index 0000000..debc2ee Binary files /dev/null and b/tests/images/QYT_KT-8R.img differ diff --git a/tests/images/QYT_KT-WP12.img b/tests/images/QYT_KT-WP12.img new file mode 100644 index 0000000..93e92df Binary files /dev/null and b/tests/images/QYT_KT-WP12.img differ diff --git a/tests/images/Quansheng_TG-UV2+.img b/tests/images/Quansheng_TG-UV2+.img new file mode 100644 index 0000000..71ed9aa Binary files /dev/null and b/tests/images/Quansheng_TG-UV2+.img differ diff --git a/tests/images/Radioddity_GA-510.img b/tests/images/Radioddity_GA-510.img new file mode 100644 index 0000000..cadbe21 Binary files /dev/null and b/tests/images/Radioddity_GA-510.img differ diff --git a/tests/images/Radioddity_UV-5G.img b/tests/images/Radioddity_UV-5G.img new file mode 100644 index 0000000..1fa459e Binary files /dev/null and b/tests/images/Radioddity_UV-5G.img differ diff --git a/tests/images/Retevis_RA85.img b/tests/images/Retevis_RA85.img new file mode 100644 index 0000000..aa6efc0 Binary files /dev/null and b/tests/images/Retevis_RA85.img differ diff --git a/tests/images/Retevis_RB15.img b/tests/images/Retevis_RB15.img new file mode 100644 index 0000000..2630dbc Binary files /dev/null and b/tests/images/Retevis_RB15.img differ diff --git a/tests/images/Retevis_RB17.img b/tests/images/Retevis_RB17.img new file mode 100644 index 0000000..7c061ab Binary files /dev/null and b/tests/images/Retevis_RB17.img differ diff --git a/tests/images/Retevis_RB17A.img b/tests/images/Retevis_RB17A.img new file mode 100644 index 0000000..36ed38e Binary files /dev/null and b/tests/images/Retevis_RB17A.img differ diff --git a/tests/images/Retevis_RB17P.img b/tests/images/Retevis_RB17P.img new file mode 100644 index 0000000..eb9f559 Binary files /dev/null and b/tests/images/Retevis_RB17P.img differ diff --git a/tests/images/Retevis_RB17V.img b/tests/images/Retevis_RB17V.img new file mode 100644 index 0000000..4a7811e Binary files /dev/null and b/tests/images/Retevis_RB17V.img differ diff --git a/tests/images/Retevis_RB18.img b/tests/images/Retevis_RB18.img new file mode 100644 index 0000000..c60af0a Binary files /dev/null and b/tests/images/Retevis_RB18.img differ diff --git a/tests/images/Retevis_RB19.img b/tests/images/Retevis_RB19.img new file mode 100644 index 0000000..0576e84 Binary files /dev/null and b/tests/images/Retevis_RB19.img differ diff --git a/tests/images/Retevis_RB19P.img b/tests/images/Retevis_RB19P.img new file mode 100644 index 0000000..89293f0 Binary files /dev/null and b/tests/images/Retevis_RB19P.img differ diff --git a/tests/images/Retevis_RB23.img b/tests/images/Retevis_RB23.img new file mode 100644 index 0000000..b9c8a00 Binary files /dev/null and b/tests/images/Retevis_RB23.img differ diff --git a/tests/images/Retevis_RB26.img b/tests/images/Retevis_RB26.img new file mode 100644 index 0000000..b39c873 Binary files /dev/null and b/tests/images/Retevis_RB26.img differ diff --git a/tests/images/Retevis_RB27.img b/tests/images/Retevis_RB27.img new file mode 100644 index 0000000..3dbb4f5 Binary files /dev/null and b/tests/images/Retevis_RB27.img differ diff --git a/tests/images/Retevis_RB27B.img b/tests/images/Retevis_RB27B.img new file mode 100644 index 0000000..c10f2b4 Binary files /dev/null and b/tests/images/Retevis_RB27B.img differ diff --git a/tests/images/Retevis_RB27V.img b/tests/images/Retevis_RB27V.img new file mode 100644 index 0000000..52f8580 Binary files /dev/null and b/tests/images/Retevis_RB27V.img differ diff --git a/tests/images/Retevis_RB615.img b/tests/images/Retevis_RB615.img new file mode 100644 index 0000000..c60f2b5 Binary files /dev/null and b/tests/images/Retevis_RB615.img differ diff --git a/tests/images/Retevis_RB617.img b/tests/images/Retevis_RB617.img new file mode 100644 index 0000000..22a20ea Binary files /dev/null and b/tests/images/Retevis_RB617.img differ diff --git a/tests/images/Retevis_RB618.img b/tests/images/Retevis_RB618.img new file mode 100644 index 0000000..7681b15 Binary files /dev/null and b/tests/images/Retevis_RB618.img differ diff --git a/tests/images/Retevis_RB619.img b/tests/images/Retevis_RB619.img new file mode 100644 index 0000000..620e81c Binary files /dev/null and b/tests/images/Retevis_RB619.img differ diff --git a/tests/images/Retevis_RB627B.img b/tests/images/Retevis_RB627B.img new file mode 100644 index 0000000..b7f06ee Binary files /dev/null and b/tests/images/Retevis_RB627B.img differ diff --git a/tests/images/Retevis_RB75.img b/tests/images/Retevis_RB75.img new file mode 100644 index 0000000..304c04c Binary files /dev/null and b/tests/images/Retevis_RB75.img differ diff --git a/tests/images/Retevis_RB85.img b/tests/images/Retevis_RB85.img new file mode 100644 index 0000000..a9e83ba Binary files /dev/null and b/tests/images/Retevis_RB85.img differ diff --git a/tests/images/Retevis_RT1.img b/tests/images/Retevis_RT1.img new file mode 100644 index 0000000..cac0d24 Binary files /dev/null and b/tests/images/Retevis_RT1.img differ diff --git a/tests/images/Retevis_RT16.img b/tests/images/Retevis_RT16.img new file mode 100644 index 0000000..72d08f2 Binary files /dev/null and b/tests/images/Retevis_RT16.img differ diff --git a/tests/images/Retevis_RT19.img b/tests/images/Retevis_RT19.img new file mode 100644 index 0000000..62b5aa0 Binary files /dev/null and b/tests/images/Retevis_RT19.img differ diff --git a/tests/images/Retevis_RT22FRS.img b/tests/images/Retevis_RT22FRS.img new file mode 100644 index 0000000..cafce14 Binary files /dev/null and b/tests/images/Retevis_RT22FRS.img differ diff --git a/tests/images/Retevis_RT22S.img b/tests/images/Retevis_RT22S.img new file mode 100644 index 0000000..e0a9fa6 Binary files /dev/null and b/tests/images/Retevis_RT22S.img differ diff --git a/tests/images/Retevis_RT29_UHF.img b/tests/images/Retevis_RT29_UHF.img new file mode 100644 index 0000000..381ee00 Binary files /dev/null and b/tests/images/Retevis_RT29_UHF.img differ diff --git a/tests/images/Retevis_RT29_VHF.img b/tests/images/Retevis_RT29_VHF.img new file mode 100644 index 0000000..ee275c0 Binary files /dev/null and b/tests/images/Retevis_RT29_VHF.img differ diff --git a/tests/images/Retevis_RT40B.img b/tests/images/Retevis_RT40B.img new file mode 100644 index 0000000..2d3d480 Binary files /dev/null and b/tests/images/Retevis_RT40B.img differ diff --git a/tests/images/Retevis_RT47.img b/tests/images/Retevis_RT47.img new file mode 100644 index 0000000..9aea994 Binary files /dev/null and b/tests/images/Retevis_RT47.img differ diff --git a/tests/images/Retevis_RT47V.img b/tests/images/Retevis_RT47V.img new file mode 100644 index 0000000..b95d9a0 Binary files /dev/null and b/tests/images/Retevis_RT47V.img differ diff --git a/tests/images/Retevis_RT619.img b/tests/images/Retevis_RT619.img new file mode 100644 index 0000000..6db1598 Binary files /dev/null and b/tests/images/Retevis_RT619.img differ diff --git a/tests/images/Retevis_RT622.img b/tests/images/Retevis_RT622.img new file mode 100644 index 0000000..13a3419 Binary files /dev/null and b/tests/images/Retevis_RT622.img differ diff --git a/tests/images/Retevis_RT647.img b/tests/images/Retevis_RT647.img new file mode 100644 index 0000000..33fdae0 Binary files /dev/null and b/tests/images/Retevis_RT647.img differ diff --git a/tests/images/Retevis_RT668.img b/tests/images/Retevis_RT668.img new file mode 100644 index 0000000..9ff00d0 Binary files /dev/null and b/tests/images/Retevis_RT668.img differ diff --git a/tests/images/Retevis_RT68.img b/tests/images/Retevis_RT68.img new file mode 100644 index 0000000..7c14049 Binary files /dev/null and b/tests/images/Retevis_RT68.img differ diff --git a/tests/images/Retevis_RT76.img b/tests/images/Retevis_RT76.img new file mode 100644 index 0000000..e716ae9 Binary files /dev/null and b/tests/images/Retevis_RT76.img differ diff --git a/tests/images/Retevis_RT87.img b/tests/images/Retevis_RT87.img new file mode 100644 index 0000000..383716a Binary files /dev/null and b/tests/images/Retevis_RT87.img differ diff --git a/tests/images/Retevis_RT9000D_136-174.img b/tests/images/Retevis_RT9000D_136-174.img new file mode 100644 index 0000000..3cb8813 Binary files /dev/null and b/tests/images/Retevis_RT9000D_136-174.img differ diff --git a/tests/images/Retevis_RT9000D_220-260.img b/tests/images/Retevis_RT9000D_220-260.img new file mode 100644 index 0000000..d1f16fb Binary files /dev/null and b/tests/images/Retevis_RT9000D_220-260.img differ diff --git a/tests/images/Retevis_RT9000D_400-490.img b/tests/images/Retevis_RT9000D_400-490.img new file mode 100644 index 0000000..bfa52f3 Binary files /dev/null and b/tests/images/Retevis_RT9000D_400-490.img differ diff --git a/tests/images/Retevis_RT9000D_66-88.img b/tests/images/Retevis_RT9000D_66-88.img new file mode 100644 index 0000000..2bf04e0 Binary files /dev/null and b/tests/images/Retevis_RT9000D_66-88.img differ diff --git a/tests/images/Retevis_RT95.img b/tests/images/Retevis_RT95.img new file mode 100644 index 0000000..e1f2f65 Binary files /dev/null and b/tests/images/Retevis_RT95.img differ diff --git a/tests/images/Rugged_RH5R-V2.img b/tests/images/Rugged_RH5R-V2.img new file mode 100644 index 0000000..56c3e80 Binary files /dev/null and b/tests/images/Rugged_RH5R-V2.img differ diff --git a/tests/images/TYT_TH-UV88.img b/tests/images/TYT_TH-UV88.img new file mode 100644 index 0000000..8796711 Binary files /dev/null and b/tests/images/TYT_TH-UV88.img differ diff --git a/tests/images/Vertex_Standard_FTL-2011.img b/tests/images/Vertex_Standard_FTL-2011.img new file mode 100644 index 0000000..5eff340 Binary files /dev/null and b/tests/images/Vertex_Standard_FTL-2011.img differ diff --git a/tests/images/Wouxun_KG-935G.img b/tests/images/Wouxun_KG-935G.img new file mode 100644 index 0000000..033f0d7 Binary files /dev/null and b/tests/images/Wouxun_KG-935G.img differ diff --git a/tests/images/Wouxun_KG-UV920P-A.img b/tests/images/Wouxun_KG-UV920P-A.img new file mode 100644 index 0000000..6fc02f8 Binary files /dev/null and b/tests/images/Wouxun_KG-UV920P-A.img differ diff --git a/tests/images/Yaesu_FTM-7250D_R.img b/tests/images/Yaesu_FTM-7250D_R.img new file mode 100755 index 0000000..2ec6832 Binary files /dev/null and b/tests/images/Yaesu_FTM-7250D_R.img differ diff --git a/tests/py3_driver_testers.txt b/tests/py3_driver_testers.txt new file mode 100644 index 0000000..ed5a37d --- /dev/null +++ b/tests/py3_driver_testers.txt @@ -0,0 +1,41 @@ +# Format is: +# Driver_ID,Tester,Test Date +# Tester is preferred as a github id, but obfuscated email or name is +# acceptable. If a driver is literally identical to another, use +# +DRIVER_KEY to mark it as implied-tested. +# Actually Arcshell AR-6 which is a direct clone +Baofeng_BF-888,@kk7ds,13-Feb-2019 +Baofeng_UV-3R,@yarda,26-Sep-2022 +Baofeng_UV-5R,@lekv,23-Oct-2022 +Icom_IC-2200H,@kk7ds,24-Oct-2022 +Icom_IC-2820H,@kk7ds,22-Oct-2022 +Icom_IC-7200,@kk7ds,22-Oct-2022 +Icom_IC-7300,@kk7ds,22-Oct-2022 +Icom_IC-7610,@kk7ds,24-Oct-2022 +Icom_IC-910,@mfncooper,1-Oct-2021 +Icom_ID-31A,@kk7ds,12-Feb-2019 +Icom_ID-800H_v2,@kk7ds,22-Oct-2022 +Icom_ID-880H,@kk7ds,22-Oct-2022 +Kenwood_TH-D72_live_mode,@kk7ds,21-Oct-2022 +Kenwood_TH-D74_live_mode,@kk7ds,20-Oct-2022 +Kenwood_TH-F7,@sv1,19-Oct-2022 +Kenwood_TM-271,+Kenwood_TM-281,23-Oct-2022 +Kenwood_TM-281,@kk7ds,23-Oct-2022 +Kenwood_TM-D700,@kk7ds,20-Oct-2022 +Kenwood_TM-D710G,@kk7ds,22-Oct-2022 +Kenwood_TM-D710G_CloneMode,@kk7ds,22-Oct-2022 +Kenwood_TM-V71,@kk7ds,21-Oct-2022 +Kenwood_TK-7102,@kk7ds,15-Feb-2019 +Kenwood_TK-7108,@kk7ds,15-Feb-2019 +Kenwood_TK-7180,@kk7ds,18-Oct-2022 +Kenwood_TK-8102,@kk7ds,15-Feb-2019 +Kenwood_TK-8108,@kk7ds,15-Feb-2019 +Kenwood_TK-8180,@kk7ds,18-Oct-2022 +Radioddity_GA-510,@kk7ds,21-Oct-2022 +TIDRADIO_TD-H6,@kk7ds,21-Oct-2022 +Yaesu_FT-7800_7900,@kk7ds,24-Oct-2022 +Yaesu_FT-8800,@kk7ds,24-Oct-2022 +Yaesu_FT-817,@kk7ds,14-Feb-2019 +Yaesu_VX-3,@kk7ds,15-Feb-2019 +Yaesu_VX-8DR,@kk7ds,15-Feb-2019 +Yaesu_VX-7,@kk7ds,15-Feb-2019 diff --git a/tests/py3_remaining.txt b/tests/py3_remaining.txt new file mode 100644 index 0000000..3f406d1 --- /dev/null +++ b/tests/py3_remaining.txt @@ -0,0 +1,17 @@ +Baojie_BJ-9900.img +LUITON_LT-725UV.img +Puxing_PX-2R.img +Puxing_PX-777.img +Puxing_PX-888K.img +TYT_TH-UV3R-25.img +TYT_TH-UV3R.img +Wouxun_KG-816.img +Wouxun_KG-818.img +Wouxun_KG-UV6.img +Wouxun_KG-UVD1P.img +Yaesu_FT-1D_R.img +Yaesu_FT2D_R.img +Yaesu_FT3D_R.img +Yaesu_FT-450D.img +Yaesu_FTM-3200D_R.img +Yaesu_FTM-7250D_R.img diff --git a/tests/run_tests.py b/tests/run_tests.py index 195f4c4..671b3dc 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -451,7 +451,9 @@ class TestCaseBruteForce(TestCase): tmp = copy.deepcopy(m) if mode not in chirp_common.MODES: continue - if mode == "DV": + if mode == "DV" and \ + isinstance(self._wrapper._dst, + chirp_common.IcomDstarSupport): tmp = chirp_common.DVMemory() try: ensure_urcall(tmp.dv_urcall) @@ -895,8 +897,9 @@ class TestCaseDetect(TestCase): elif issubclass(radio.__class__, self._wrapper._dstclass): pass elif radio.__class__ != self._wrapper._dstclass: - raise TestFailedError("%s detected as %s" % - (self._wrapper._dstclass, radio.__class__)) + raise TestFailedError("%s detected as %s for %s" % + (self._wrapper._dstclass, radio.__class__, + filename)) return [] TESTS["Detect"] = TestCaseDetect @@ -1342,8 +1345,10 @@ Available tests: test_out = TestOutputHTML(options.html) else: stdout = sys.stdout - if not os.path.exists("logs"): + try: os.mkdir("logs") + except FileExistsError: + pass sys.stdout = open("logs/verbose", "w") test_out = TestOutputANSI(stdout) diff --git a/tests/unit/base.py b/tests/unit/base.py index 1e112ce..8b90a44 100644 --- a/tests/unit/base.py +++ b/tests/unit/base.py @@ -48,3 +48,12 @@ def mock_gtk(): def unmock_gtk(): for module in pygtk_mocks: del sys.modules[module] + + +class BaseGTKTest(BaseTest): + def setUp(self): + super(BaseGTKTest, self).setUp() + try: + import gtk + except ImportError: + self.skipTest('pygtk not available') diff --git a/tests/unit/test_directory.py b/tests/unit/test_directory.py index d48bb48..c447173 100644 --- a/tests/unit/test_directory.py +++ b/tests/unit/test_directory.py @@ -1,5 +1,7 @@ import base64 +import glob import json +import os import tempfile from tests.unit import base @@ -67,3 +69,26 @@ class TestDirectory(base.BaseTest): self.assertEqual('Barmaster 2000', radio.MODEL) self.assertEqual('A', radio.VARIANT) + +class TestDetectBruteForce(base.BaseTest): + def test_detect_all(self): + # Attempt a brute-force detection of all test images. + # + # This confirms that no test image is detected by more than one + # radio class. If it is, fail and report those classes. + + path = os.path.dirname(__file__) + path = os.path.join(path, '..', 'images', '*.img') + test_images = glob.glob(path) + self.assertNotEqual(0, len(test_images)) + for image in test_images: + detections = [] + filedata = open(image, 'rb').read() + for cls in directory.RADIO_TO_DRV: + if not hasattr(cls, 'match_model'): + continue + if cls.match_model(filedata, image): + detections.append(cls) + if len(detections) > 1: + raise Exception('Detection of %s failed: %s' % (image, + detections)) diff --git a/tests/unit/test_memedit_edits.py b/tests/unit/test_memedit_edits.py index fdf971c..b024353 100644 --- a/tests/unit/test_memedit_edits.py +++ b/tests/unit/test_memedit_edits.py @@ -6,21 +6,13 @@ from tests.unit import base __builtins__["_"] = lambda s: s -memedit = None - - -class TestEdits(base.BaseTest): - def setUp(self): - global memedit - super(TestEdits, self).setUp() - base.mock_gtk() - from chirp.ui import memedit as memedit_module - memedit = memedit_module +try: + from chirp.ui import memedit +except ImportError: + memedit = None - def tearDown(self): - super(TestEdits, self).tearDown() - base.unmock_gtk() +class TestEdits(base.BaseGTKTest): def _test_tone_column_change(self, col, ini_tmode='', ini_cmode='', exp_tmode=None, exp_cmode=None): diff --git a/tests/unit/test_settings.py b/tests/unit/test_settings.py index ccc4308..3fb84f0 100644 --- a/tests/unit/test_settings.py +++ b/tests/unit/test_settings.py @@ -54,6 +54,28 @@ class TestSettingValues(base.BaseTest): self._set_and_catch(value, "Jkl", "Xyz") self.assertEqual(value.get_options(), opts) + def test_radio_setting_value_list_by_index(self): + opts = ["Abc", "Def", "Ghi"] + value = settings.RadioSettingValueList(opts, current_index=1) + self.assertEqual(value.get_value(), "Def") + self.assertEqual(int(value), 1) + self._set_and_test(value, "Def", "Ghi", "Abc") + self._set_and_catch(value, "Jkl", "Xyz") + self.assertEqual(value.get_options(), opts) + + # Make sure we int() the index, as we may pass a bitwise object + value = settings.RadioSettingValueList(opts, current_index='1') + self.assertEqual(value.get_value(), "Def") + + value.set_index(0) + self.assertEqual(value.get_value(), 'Abc') + + # Same here, int() the index + value.set_index('0') + self.assertEqual(value.get_value(), 'Abc') + + self.assertRaises(IndexError, value.set_index, 7) + def test_radio_setting_value_string(self): value = settings.RadioSettingValueString(1, 5, "foo", autopad=False) self.assertEqual(value.get_value(), "foo") @@ -111,6 +133,8 @@ class TestSettingContainers(base.BaseTest): self.assertEqual(rs.value, val) rs.value = False self.assertEqual(val.get_value(), False) + self.assertEqual('foo:False', str(rs)) + self.assertEqual('[RadioSetting foo:False]', repr(rs)) def test_radio_setting_multi(self): val1 = settings.RadioSettingValueBoolean(True) diff --git a/tests/unit/test_shiftdialog.py b/tests/unit/test_shiftdialog.py index fe0b62d..227c1af 100644 --- a/tests/unit/test_shiftdialog.py +++ b/tests/unit/test_shiftdialog.py @@ -5,6 +5,10 @@ except ImportError: from mox3 import mox from tests.unit import base +try: + from chirp.ui import shiftdialog +except ImportError: + shiftdialog = None from chirp import chirp_common from chirp import errors @@ -50,18 +54,7 @@ class FakeRadioThread(object): pass -class ShiftDialogTest(base.BaseTest): - def setUp(self): - global shiftdialog - super(ShiftDialogTest, self).setUp() - base.mock_gtk() - from chirp.ui import shiftdialog as shiftdialog_module - shiftdialog = shiftdialog_module - - def tearDown(self): - super(ShiftDialogTest, self).tearDown() - base.unmock_gtk() - +class ShiftDialogTest(base.BaseGTKTest): def _test_hole(self, fn, starting, arg, expected): radio = FakeRadio(*tuple(starting)) radio.get_features().memory_bounds = (0, 5) diff --git a/tests/unit/test_wxui_radiothread.py b/tests/unit/test_wxui_radiothread.py new file mode 100644 index 0000000..c60da8c --- /dev/null +++ b/tests/unit/test_wxui_radiothread.py @@ -0,0 +1,105 @@ +import sys +import time +from unittest import mock + +sys.modules['wx'] = wx = mock.MagicMock() + +from tests.unit import base +from chirp.wxui import radiothread + + +class TestRadioThread(base.BaseTest): + def setUp(self): + super().setUp() + + def test_radiojob(self): + radio = mock.MagicMock() + editor = mock.MagicMock() + job = radiothread.RadioJob(editor, 'get_memory', [12], {}) + self.assertIsNone(job.dispatch(radio)) + radio.get_memory.assert_called_once_with(12) + self.assertEqual(job.result, radio.get_memory.return_value) + + def test_radiojob_exception(self): + radio = mock.MagicMock() + radio.get_memory.side_effect = ValueError('some error') + editor = mock.MagicMock() + job = radiothread.RadioJob(editor, 'get_memory', [12], {}) + self.assertIsNone(job.dispatch(radio)) + radio.get_memory.assert_called_once_with(12) + self.assertIsInstance(job.result, ValueError) + + def test_thread(self): + radio = mock.MagicMock() + radio.get_features.side_effect = ValueError('some error') + editor = mock.MagicMock() + # Simulate an edit conflict with the first event by returning + # False for "delivered" to force us to queue an event. + editor.radio_thread_event.side_effect = [False, True, True, True] + thread = radiothread.RadioThread(radio) + mem = mock.MagicMock() + job1id = thread.submit(editor, 'get_memory', 12) + job2id = thread.submit(editor, 'set_memory', mem) + job3id = thread.submit(editor, 'get_features') + # We have to start the thread after we submit the main jobs so + # the order is stable for comparison. + thread.start() + + # Wait for the main jobs to be processed before we signal exit + while not all([radio.get_memory.called, + radio.set_memory.called, + radio.get_features.called]): + time.sleep(0.1) + + thread.end() + thread.join(5) + self.assertFalse(thread.is_alive()) + radio.get_memory.assert_called_once_with(12) + radio.set_memory.assert_called_once_with(mem) + radio.get_features.assert_called_once_with() + self.assertEqual(4, editor.radio_thread_event.call_count) + + # We expect the jobs to be delivered in order of + # priority. Since we return False for the first call to + # radio_thread_event(), job2 should be queued and then + # delivered first on the next cycle. + expected_order = [job2id, job2id, job3id, job1id] + for i, (jobid, call) in enumerate( + zip(expected_order, + editor.radio_thread_event.call_args_list)): + job = call[0][0] + self.assertEqual(jobid, job.id) + + # We should call non-blocking for every call except the last + # one, when the queue is empty + editor.radio_thread_event.assert_has_calls([ + mock.call(mock.ANY, block=False), + mock.call(mock.ANY, block=False), + mock.call(mock.ANY, block=False), + mock.call(mock.ANY, block=True), + ]) + + def test_thread_abort_priority(self): + radio = mock.MagicMock() + radio.get_features.side_effect = ValueError('some error') + editor = mock.MagicMock() + thread = radiothread.RadioThread(radio) + mem = mock.MagicMock() + job1id = thread.submit(editor, 'get_memory', 12) + job2id = thread.submit(editor, 'set_memory', mem) + job3id = thread.submit(editor, 'get_features') + thread.end() + # We have to start the thread after we submit the main jobs so + # the order is stable for comparison. + thread.start() + + thread.join(5) + self.assertFalse(thread.is_alive()) + + # Our end sentinel should have gone to the head of the queue + # so that exiting the application does not leave a thread + # running in the background fetching hundreds of memories. + radio.get_memory.assert_not_called() + radio.set_memory.assert_not_called() + radio.get_features.assert_not_called() + wx.PostEvent.assert_not_called() -- cgit v1.2.3