Пример #1
0
    def test_create(self, tx_storage: TXStorageMemory):
        ack = AckMessage(amount=Decimal("10"), status=Status.NEW, txid="0")
        order = MerchantOrderRequestMessage(amount=Decimal("10"),
                                            session_id="123",
                                            fiat_currency="EUR")

        tx_storage.create(0, "123", "app0@user0", order, ack)

        assert 1 == len(tx_storage)
Пример #2
0
    def test_new_ack(self, tx_storage: TXStorageMemory):
        self.test_create(tx_storage)
        state = tx_storage.get_state_for_session("123")
        new_ack = attr.evolve(state.ack, status=Status.PENDING)

        state.ack = new_ack

        assert 1 == len(tx_storage)

        state = tx_storage.get_state_for_session("123")

        assert state.ack.status == Status.PENDING
Пример #3
0
 def test_get_state(self, tx_storage: TXStorageMemory):
     self.test_create(tx_storage)
     state = tx_storage.get_state_for_session("123")
     assert Status.NEW == state.ack.status
     assert "app0@user0" == state.application
Пример #4
0
def tx_storage() -> TXStorageMemory:
    return TXStorageMemory()