Skip to content

Commit

Permalink
Merge pull request #23 from RnDAO/dev_amin_discord_event
Browse files Browse the repository at this point in the history
added discord bot send message event!
  • Loading branch information
cyri113 authored Jul 1, 2023
2 parents 01f3907 + cb037b3 commit 6ad5270
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="tc-messageBroker",
version="1.2.1",
version="1.3.0",
author="Mohammad Amin Dadgar, RnDAO",
maintainer="Mohammad Amin Dadgar",
maintainer_email="[email protected]",
Expand Down
6 changes: 6 additions & 0 deletions tc_messageBroker/rabbit_mq/saga/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
order=2,
status=Status.NOT_STARTED,
),
ITransaction(
Queue.DISCORD_BOT,
Event.DISCORD_BOT.SEND_MESSAGE,
order=3,
status=Status.NOT_STARTED,
),
# ITransaction(
# Queue.DISCORD_ANALYZER,
# Event.DISCORD_ANALYZER.SAVE,
Expand Down
7 changes: 6 additions & 1 deletion tests/unit/test_predefined_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def test_discord_update_channels_tx():
tx = DISCORD_UPDATE_CHANNELS_TRANSACTIONS

assert len(tx) == 2
assert len(tx) == 3
assert tx[0].order == 1
assert tx[0].queue == Queue.DISCORD_BOT
assert tx[0].event == Event.DISCORD_BOT.FETCH
Expand All @@ -21,6 +21,11 @@ def test_discord_update_channels_tx():
assert tx[1].event == Event.DISCORD_ANALYZER.RUN
assert tx[1].status == Status.NOT_STARTED

assert tx[2].order == 3
assert tx[2].queue == Queue.DISCORD_BOT
assert tx[2].event == Event.DISCORD_BOT.SEND_MESSAGE
assert tx[2].status == Status.NOT_STARTED


def test_discord_scheduled_job_tx():
tx = DISCORD_SCHEDULED_JOB_TRANSACTIONS
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_saga_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_choreagraphy_sorting_orders_predefined_choreogprahy():
saga.choreography.transactions
)

assert not_started_count == 2
assert not_started_count == 3
order_val = 0
for tx in tx_sorted:
if tx.status == Status.NOT_STARTED:
Expand All @@ -45,7 +45,7 @@ def test_assert_sorting_status_predefined_choreagprahy():
saga.choreography.transactions
)

assert not_started_count == 2
assert not_started_count == 3

condition = False
for tx in tx_sorted:
Expand Down

0 comments on commit 6ad5270

Please sign in to comment.