Example #1
0
    def test_handle_with_oob_invalid_class_with_default(self):
        handler = OOBHandler()

        handler.oobs['test'] = DefaultOutOfBandProcessor()
        handler.oobs['default'] = DefaultOutOfBandProcessor()

        response = handler.handle(None, "<oob><camera>on</camera></oob>")
        self.assertEqual("", response)
Example #2
0
    def test_processor(self):
        oob_processor = DefaultOutOfBandProcessor()
        self.assertIsNotNone(oob_processor)

        self.assertEqual("", oob_processor.execute_oob_command(self._client_context))

        oob_content = ET.fromstring("<something>process</something>")
        self.assertEqual("", oob_processor.process_out_of_bounds(self._client_context, oob_content))
Example #3
0
    def test_load_configuration_only_default(self):

        handler = OOBHandler()
        handler.oobs['default'] = DefaultOutOfBandProcessor()

        self.assertTrue('default' in handler.oobs)
        self.assertIsInstance(handler.default_oob, DefaultOutOfBandProcessor)
Example #4
0
    def test_process_oob_no_oob(self):
        client = TestClient()
        self._client_context = client.create_client_context("testid")

        handler = OOBHandler()

        handler.oobs['camera'] = CameraOutOfBandProcessor()
        handler.oobs['default'] = DefaultOutOfBandProcessor()

        response = handler.process_oob(self._client_context, "<camera>on</camera>")
        self.assertEquals("", response)
Example #5
0
    def load_oob_processors(self, storage_factory):
        if storage_factory.entity_storage_engine_available(
                StorageFactory.OOBS) is True:
            storage_engine = storage_factory.entity_storage_engine(
                StorageFactory.OOBS)
            oobs_store = storage_engine.oobs_store()
            oobs_store.load(self)
        else:
            YLogger.error(None, "No storage engine available for oobs!")

        if self._oobs.get('default', None) is None:
            self._oobs['default'] = DefaultOutOfBandProcessor()
Example #6
0
    def test_load_configuration_no_default(self):
        handler = OOBHandler()
        handler.oobs['test'] = DefaultOutOfBandProcessor()

        self.assertTrue("test" in handler.oobs)
        self.assertEqual(None, handler.default_oob)