def test_perform(self): data = ChurchData(**Generate.church_data()[0]) with evaluate("Church:Create") as report: portfolio = CreateChurchEntity().perform(data) self.assertIsNotNone(portfolio.entity) self.assertIsNotNone(portfolio.privkeys) self.assertIsNotNone(portfolio.keys) self.assertTrue(report)
def test_perform(self): first, second = Generate.church_data(2) portfolio = CreateChurchEntity().perform(ChurchData(**first)) new_data(first, second, portfolio.entity.changeables()) data = ChurchData(**second) with evaluate("Ministry:Update") as report: entity = UpdateChurchEntity().perform(portfolio, data) self.assertTrue(report)
def test_perform(self): data = ChurchData(**Generate.church_data()[0]) portfolio = CreateChurchEntity().perform(data) domain = CreateDomain().perform(portfolio) CreateNode().current(portfolio, server=True) with evaluate("Network:Create") as report: network = CreateNetwork().perform(portfolio) self.assertIs(network, portfolio.network) self.assertEqual(network.domain, domain.id) self.assertEqual(len(network.hosts), 1) self.assertTrue(report)
def test_validate(self): portfolio = CreateChurchEntity().perform(ChurchData(**Generate.church_data()[0])) CreateDomain().perform(portfolio) CreateNode().current(portfolio, server=True) foreign_porfolio = portfolio.to_portfolio() self.assertIsNone(foreign_porfolio.network) network = CreateNetwork().perform(portfolio) with evaluate("Network:Accept") as report: AcceptNetwork().validate(foreign_porfolio, network) self.assertIs(network, foreign_porfolio.network) self.assertTrue(report)
def test_validate(self): portfolio = CreateChurchEntity().perform(ChurchData(**Generate.church_data()[0])) CreateDomain().perform(portfolio) CreateNode().current(portfolio, server=True) foreign_porfolio = portfolio.to_portfolio() self.assertIsNone(foreign_porfolio.network) network = CreateNetwork().perform(portfolio) AcceptNetwork().validate(foreign_porfolio, network) CreateNode().perform(portfolio, device="test", serial="1234567890", ip=IPv4Address("127.0.0.1"), server=True) network = UpdateNetwork().perform(portfolio) with evaluate("Network:Validate") as report: ValidateNetwork().validate(foreign_porfolio, network) self.assertIs(network, foreign_porfolio.network) self.assertTrue(report)
def test_perform(self): portfolio = CreateChurchEntity().perform( ChurchData(**Generate.church_data()[0])) domain = CreateDomain().perform(portfolio) CreateNode().current(portfolio, server=True) CreateNetwork().perform(portfolio) CreateNode().perform(portfolio, device="test", serial="1234567890", ip=IPv4Address("127.0.0.1"), server=True) with evaluate("Network:Update") as report: network = UpdateNetwork().perform(portfolio) self.assertIs(network, portfolio.network) self.assertEqual(network.domain, domain.id) self.assertEqual(len(network.hosts), 2) self.assertTrue(report)
def test_perform(self): data = ChurchData(**Generate.church_data()[0]) with evaluate("Church:Setup") as report: portfolio = SetupChurchPortfolio().perform(data, server=True) self.assertTrue(report)