def test_get_state_with_multiple_cbsds(self):
        some_cbsd = DBCbsdBuilder(). \
            with_state(self.unregistered). \
            with_registration('some'). \
            with_eirp_capabilities(0, 10, 20, 1). \
            with_active_mode_config(self.registered). \
            build()
        other_cbsd = DBCbsdBuilder(). \
            with_state(self.registered). \
            with_registration('other'). \
            with_eirp_capabilities(5, 15, 25, 3). \
            with_active_mode_config(self.registered). \
            build()
        self.session.add_all([some_cbsd, other_cbsd])
        self.session.commit()

        some_config = ActiveModeConfigBuilder(). \
            with_state(Unregistered). \
            with_registration('some'). \
            with_eirp_capabilities(0, 10, 20, 1). \
            with_desired_state(Registered). \
            build()
        other_config = ActiveModeConfigBuilder(). \
            with_state(Registered). \
            with_registration('other'). \
            with_eirp_capabilities(5, 15, 25, 3). \
            with_desired_state(Registered). \
            build()
        expected = State(active_mode_configs=[some_config, other_config])

        actual = self.amc_service.GetState(GetStateRequest(), None)
        self.assertEqual(expected, actual)
    def test_should_send_data_if_cbsd_needs_deletion(self):
        cbsd = DBCbsdBuilder(). \
            with_id(SOME_ID). \
            with_state(self.registered). \
            with_desired_state(self.registered). \
            with_registration('some'). \
            with_max_ibw(1000). \
            with_carrier_aggregation(True). \
            with_available_frequencies(FREQUENCIES). \
            deleted(). \
            build()
        self.session.add(cbsd)
        self.session.commit()

        am_cbsd = ActiveModeCbsdBuilder(). \
            with_id(SOME_ID). \
            with_state(Registered). \
            with_desired_state(Registered). \
            with_registration('some'). \
            deleted(). \
            with_category('b'). \
            with_grant_settings(
            GrantSettings(
                grant_redundancy_enabled=True,
                carrier_aggregation_enabled=True,
                max_ibw_mhz=1000,
                available_frequencies=FREQUENCIES,
            ),
            ).build()  # noqa: E123
        expected = State(cbsds=[am_cbsd])

        actual = self.amc_service.GetState(GetStateRequest(), None)
        self.assertEqual(expected, actual)
Beispiel #3
0
 def _prepare_base_cbsd(self) -> DBCbsdBuilder:
     return DBCbsdBuilder(). \
         with_id(SOME_ID). \
         with_state(self.unregistered). \
         with_registration('some'). \
         with_eirp_capabilities(0, 10, 20, 1). \
         with_active_mode_config(self.registered)
 def _prepare_base_cbsd(self) -> DBCbsdBuilder:
     return DBCbsdBuilder(). \
         with_id(SOME_ID). \
         with_category('a'). \
         with_state(self.unregistered). \
         with_registration('some'). \
         with_eirp_capabilities(0, 10, 1). \
         with_antenna_gain(20). \
         with_desired_state(self.registered). \
         with_max_ibw(1000). \
         with_carrier_aggregation(True). \
         with_available_frequencies(FREQUENCIES)
    def test_not_get_state_without_eirp_capabilities(self):
        cbsd = DBCbsdBuilder(). \
            with_state(self.unregistered). \
            with_registration('some'). \
            with_desired_state(self.registered). \
            build()
        self.session.add(cbsd)
        self.session.commit()

        expected = State()

        actual = self.amc_service.GetState(GetStateRequest(), None)
        self.assertEqual(expected, actual)
Beispiel #6
0
    def test_not_get_state_without_registration_params(self):
        cbsd = DBCbsdBuilder(). \
            with_state(self.unregistered). \
            with_eirp_capabilities(0, 10, 20, 1). \
            with_active_mode_config(self.registered). \
            build()
        self.session.add(cbsd)
        self.session.commit()

        expected = State()

        actual = self.amc_service.GetState(GetStateRequest(), None)
        self.assertEqual(expected, actual)