Ejemplo n.º 1
0
    def setUp(self):
        super(ContractCheckerTest, self).setUp()
        self.p_terminated_contract = p_terminated_contract(
            self.contracting_client_with_create, dockey=self.dockey)

        self.checker = ContractChecker(self.contracting_client)
        self.message = {
            "contract_id": self.p_terminated_contract.data.id,
        }
Ejemplo n.º 2
0
    def setUp(self):
        super(ContractCheckerWhenContractAlreadyPatched, self).setUp()
        self.p_terminated_contract = p_terminated_contract(
            self.contracting_client_with_create, dockey=self.dockey)

        self.checker = ContractChecker(self.contracting_client)
        not_found_handler = ContractNotFoundHandler()
        ready_contract_handler = ContractAlreadyTerminatedHandler()
        self.checker.register_observer(not_found_handler)
        self.checker.register_observer(ready_contract_handler)
        self.message = {
            "contract_id": self.p_terminated_contract.data.id,
        }
Ejemplo n.º 3
0
    def setUp(self):
        super(CeasefireLokiTest, self).setUp()

        clean_db(self.db)  # db must not have contracts without real lots related
        self.pt_contract = p_terminated_contract(self.contracting_client_with_create, dockey=self.dockey)
        self.lot_id = active_contracting_lot(self.pt_contract.data.id, self.db)

        # fixtures must be pointing each other
        interconnect_contract_with_lot(self.pt_contract.data.id, self.lot_id, self.db)

        sleep_time_range = (
            self.config.runner.sleep_seconds.min,
            self.config.runner.sleep_seconds.max
        )
        self.runner = CeasefireLokiRunner(
            self.db, self.contracting_client, self.lots_client, sleep_time_range
        )
Ejemplo n.º 4
0
    def setUp(self):
        super(LotContractPatcherTest, self).setUp()
        self.contract = p_terminated_contract(
            self.contracting_client_with_create, dockey=self.dockey)
        self.lot_id = active_contracting_lot(self.contract.data.id, self.db)
        lot_contract_id = interconnect_contract_with_lot(
            self.contract.data.id, self.lot_id, self.db)

        self.patcher = LotContractPatcher(self.lots_client)

        self.message = {
            "lot_id": self.lot_id,
            "contract_id": self.contract.data.id,
            "contract_status": self.contract.data.status,
            "lot_contract_status": "scheduled",
            "lot_contract_id": lot_contract_id
        }
Ejemplo n.º 5
0
 def setUp(self):
     super(WatcherUpdateTest, self).setUp()
     p_terminated_contract(self.contracting_client_with_create,
                           dockey=self.dockey)
     p_unsuccessful_contract(self.contracting_client_with_create)