@@ -3038,35 +3038,63 @@ def test_set_module_OutputAmplitudeTargetRx_settings(self):
30383038 assert self .api .xcvr_eeprom .write .call_count == 4
30393039
30403040 def test_get_error_description (self ):
3041- self .api .get_module_state = MagicMock ()
3042- self .api .get_module_state .return_value = 'ModuleReady'
3043- self .api .get_datapath_state = MagicMock ()
3044- self .api .get_datapath_state .return_value = {
3045- 'DP1State' : 'DataPathActivated' ,
3046- 'DP2State' : 'DataPathActivated' ,
3047- 'DP3State' : 'DataPathActivated' ,
3048- 'DP4State' : 'DataPathActivated' ,
3049- 'DP5State' : 'DataPathActivated' ,
3050- 'DP6State' : 'DataPathActivated' ,
3051- 'DP7State' : 'DataPathActivated' ,
3052- 'DP8State' : 'DataPathActivated'
3053- }
3054- self .api .get_config_datapath_hostlane_status = MagicMock ()
3055- self .api .get_config_datapath_hostlane_status .return_value = {
3056- 'ConfigStatusLane1' : 'ConfigSuccess' ,
3057- 'ConfigStatusLane2' : 'ConfigSuccess' ,
3058- 'ConfigStatusLane3' : 'ConfigSuccess' ,
3059- 'ConfigStatusLane4' : 'ConfigSuccess' ,
3060- 'ConfigStatusLane5' : 'ConfigSuccess' ,
3061- 'ConfigStatusLane6' : 'ConfigSuccess' ,
3062- 'ConfigStatusLane7' : 'ConfigSuccess' ,
3063- 'ConfigStatusLane8' : 'ConfigSuccess'
3064- }
3065- self .api .xcvr_eeprom .read = MagicMock ()
3066- self .api .xcvr_eeprom .read .return_value = 0x10
3067-
3068- result = self .api .get_error_description ()
3069- assert result is 'OK'
3041+ with patch .object (self .api , 'is_flat_memory' ) as mock_method :
3042+ mock_method .return_value = False
3043+ self .api .get_module_state = MagicMock ()
3044+ self .api .get_module_state .return_value = 'ModuleReady'
3045+ self .api .get_datapath_state = MagicMock ()
3046+ self .api .get_datapath_state .return_value = {
3047+ 'DP1State' : 'DataPathActivated' ,
3048+ 'DP2State' : 'DataPathActivated' ,
3049+ 'DP3State' : 'DataPathActivated' ,
3050+ 'DP4State' : 'DataPathActivated' ,
3051+ 'DP5State' : 'DataPathActivated' ,
3052+ 'DP6State' : 'DataPathActivated' ,
3053+ 'DP7State' : 'DataPathActivated' ,
3054+ 'DP8State' : 'DataPathActivated'
3055+ }
3056+ self .api .get_config_datapath_hostlane_status = MagicMock ()
3057+ self .api .get_config_datapath_hostlane_status .return_value = {
3058+ 'ConfigStatusLane1' : 'ConfigSuccess' ,
3059+ 'ConfigStatusLane2' : 'ConfigSuccess' ,
3060+ 'ConfigStatusLane3' : 'ConfigSuccess' ,
3061+ 'ConfigStatusLane4' : 'ConfigSuccess' ,
3062+ 'ConfigStatusLane5' : 'ConfigSuccess' ,
3063+ 'ConfigStatusLane6' : 'ConfigSuccess' ,
3064+ 'ConfigStatusLane7' : 'ConfigSuccess' ,
3065+ 'ConfigStatusLane8' : 'ConfigSuccess'
3066+ }
3067+ self .api .xcvr_eeprom .read = MagicMock ()
3068+ self .api .xcvr_eeprom .read .return_value = 0x10
3069+
3070+ result = self .api .get_error_description ()
3071+ assert result is 'OK'
3072+
3073+ self .api .get_config_datapath_hostlane_status .return_value = {
3074+ 'ConfigStatusLane1' : 'ConfigRejected' ,
3075+ 'ConfigStatusLane2' : 'ConfigRejected' ,
3076+ 'ConfigStatusLane3' : 'ConfigRejected' ,
3077+ 'ConfigStatusLane4' : 'ConfigRejected' ,
3078+ 'ConfigStatusLane5' : 'ConfigRejected' ,
3079+ 'ConfigStatusLane6' : 'ConfigRejected' ,
3080+ 'ConfigStatusLane7' : 'ConfigRejected' ,
3081+ 'ConfigStatusLane8' : 'ConfigRejected'
3082+ }
3083+ result = self .api .get_error_description ()
3084+ assert result is 'ConfigRejected'
3085+
3086+ self .api .get_datapath_state .return_value = {
3087+ 'DP1State' : 'DataPathDeactivated' ,
3088+ 'DP2State' : 'DataPathActivated' ,
3089+ 'DP3State' : 'DataPathActivated' ,
3090+ 'DP4State' : 'DataPathActivated' ,
3091+ 'DP5State' : 'DataPathActivated' ,
3092+ 'DP6State' : 'DataPathActivated' ,
3093+ 'DP7State' : 'DataPathActivated' ,
3094+ 'DP8State' : 'DataPathActivated'
3095+ }
3096+ result = self .api .get_error_description ()
3097+ assert result is 'DataPathDeactivated'
30703098
30713099 def test_random_read_fail (self ):
30723100 def mock_read_raw (offset , size ):
0 commit comments