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, SetupChurchPortfolio().perform(ChurchData(**Generate.church_data()[0])), role=Const.A_ROLE_PRIMARY, server=True )
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()
def create_server(cls) -> "FacadeContext": """Create a stub server.""" return cls( SetupChurchPortfolio().perform( ChurchData(**Generate.church_data()[0]), server=True), True)