test_01_DomainManager.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
def test_DomainManagerApplicationLifecycle(self):
        self.assertNotEqual(self._domMgr, None)
        self.assertEqual(len(self._domMgr._get_applicationFactories()), 0)
        self.assertEqual(len(self._domMgr._get_applications()), 0)

        # This filename isn't in compliance with SCA, but it is necessary for OSSIE
        self._domMgr.installApplication("/waveforms/CommandWrapper/CommandWrapper.sad.xml")
        self.assertEqual(len(self._domMgr._get_applicationFactories()), 1)
        self.assertEqual(len(self._domMgr._get_applications()), 0)

        appFact = self._domMgr._get_applicationFactories()[0]
        dom = minidom.parse(os.path.join(scatest.getSdrPath(), "dom/waveforms/CommandWrapper/CommandWrapper.sad.xml"))
        expectedId = dom.getElementsByTagName("softwareassembly")[0].getAttribute("id")
        providedId = appFact._get_identifier()
        self.assertEqual(providedId, expectedId, msg="Violation of SR:155 and/or SR:156")

        expectedName = dom.getElementsByTagName("softwareassembly")[0].getAttribute("name")
        providedName = appFact._get_name()
        self.assertEqual(providedName, expectedName, msg="Violation of SR:153")

        self._domMgr.uninstallApplication(providedId)
        self.assertEqual(len(self._domMgr._get_applicationFactories()), 0)
        self.assertEqual(len(self._domMgr._get_applications()), 0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号