コード例 #1
0
 def setUp(self) -> None:
     self.secret = os.urandom(32)
     self.dir = TemporaryDirectory()
     self.home = Path(self.dir.name)
     self.facade = Facade(self.home, self.secret,
         SetupPersonPortfolio().perform(PersonData(**Generate.church_data()[0])),
         role=Const.A_ROLE_PRIMARY, server=False
     )
コード例 #2
0
    async def test_facade(self):
        facade = Facade(self.home,
                        self.secret,
                        SetupChurchPortfolio().perform(
                            ChurchData(**Generate.church_data()[0])),
                        role=Const.A_ROLE_PRIMARY,
                        server=True)
        self.services_server(facade)
        self.assertIsInstance(facade, ChurchServerFacade)
        self.assertIsInstance(facade.data.portfolio.entity, Church)
        self.assertIsInstance(facade.data.portfolio.node, Node)
        self.extension_type(facade)
        facade.close()

        facade = Facade(self.home, self.secret)
        self.assertIsInstance(facade.data.portfolio.entity, Church)
        self.assertIsInstance(facade.data.portfolio.node, Node)
        self.extension_type(facade)
        facade.close()
コード例 #3
0
 async def create_server(cls) -> "ApplicationContext":
     """Create a stub server."""
     return await cls._setup(
         StubServer, SetupChurchPortfolio().perform(
             ChurchData(**Generate.church_data()[0]), server=StubServer.STUB_SERVER))
コード例 #4
0
ファイル: net.py プロジェクト: kristoffer-paulsson/angelos
 def create_server(cls) -> "FacadeContext":
     """Create a stub server."""
     return cls(
         SetupChurchPortfolio().perform(
             ChurchData(**Generate.church_data()[0]), server=True), True)
コード例 #5
0
ファイル: app.py プロジェクト: kristoffer-paulsson/angelos
 async def create_server(cls) -> ApplicationContext:
     """Create a stub server."""
     return await ApplicationContext.setup(StubServer, ChurchData(**Generate.church_data()[0]))