def test_tx_parameters_with_eirp_within_range( self, low_frequency_hz, high_frequency_hz, max_eirp_dbm_mhz, expected_bw_rbs, expected_earfcn, expected_tx_power, ) -> None: """Test that tx parameters of the enodeb are calculated correctly when eirp received from SAS is within acceptable range for the given bandwidth""" desired_config = EnodebConfiguration(FreedomFiOneTrDataModel()) channel = LteChannel( low_frequency_hz=low_frequency_hz, high_frequency_hz=high_frequency_hz, max_eirp_dbm_mhz=max_eirp_dbm_mhz, ) state = CBSDStateResult( radio_enabled=True, channel=channel, ) ff_one_update_desired_config_from_cbsd_state(state, desired_config) self.assert_config_updated( config=desired_config, bandwidth=expected_bw_rbs, earfcn=expected_earfcn, tx_power=expected_tx_power, radio_enabled=True, )
def test_tx_params_with_unsupported_bandwidths(self, low_frequency_hz, high_frequency_hz) -> None: """Test that tx parameters calculations raise an exception for unsupported bandwidth ranges""" desired_config = EnodebConfiguration(FreedomFiOneTrDataModel()) channel = LteChannel( low_frequency_hz=low_frequency_hz, high_frequency_hz=high_frequency_hz, max_eirp_dbm_mhz=5, ) state = CBSDStateResult( radio_enabled=True, channel=channel, ) with self.assertRaises(ConfigurationError): ff_one_update_desired_config_from_cbsd_state(state, desired_config)
def test_tx_parameters_with_eirp_out_of_range(self, max_eirp_dbm_mhz) -> None: """Test that tx parameters calculations raise an exception when eirp received from SAS is outside of acceptable range for the given bandwidth""" desired_config = EnodebConfiguration(FreedomFiOneTrDataModel()) channel = LteChannel( low_frequency_hz=3550_000_000, high_frequency_hz=3570_000_000, max_eirp_dbm_mhz=max_eirp_dbm_mhz, ) state = CBSDStateResult( radio_enabled=True, channel=channel, ) with self.assertRaises(ConfigurationError): ff_one_update_desired_config_from_cbsd_state(state, desired_config)
def test_tx_params_not_set_when_radio_disabled(self): """Test that tx parameters of the enodeb are not set when ADMIN_STATE is disabled on the radio""" desired_config = EnodebConfiguration(FreedomFiOneTrDataModel()) channel = LteChannel( low_frequency_hz=3550000000, high_frequency_hz=3570000000, max_eirp_dbm_mhz=20, ) state = CBSDStateResult( radio_enabled=False, channel=channel, ) ff_one_update_desired_config_from_cbsd_state(state, desired_config) self.assertEqual(1, len(desired_config.get_parameter_names())) self.assertFalse( desired_config.get_parameter(ParameterName.ADMIN_STATE))