Skip to content

Crud test - #1

Open
Irishery wants to merge 7 commits into
yarikdevcom:mainfrom
Irishery:crud-test
Open

Irishery wants to merge 7 commits into
yarikdevcom:mainfrom
Irishery:crud-test

Conversation

@Irishery

Copy link
Copy Markdown

Set db and added tests for bot

Comment thread app/services.py Outdated
Comment thread app/services.py Outdated
Comment thread app/services.py
Comment thread tests/test_bot.py Outdated
Comment thread app/services.py Outdated
Comment thread tests/test_bot.py Outdated
"client_id": "client123", "nickname": "Cooper123"})
assert create_one.status_code == 200

query = await container.bot.query()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't check here if created_one is inside db by doing query.get(id) and assert for example client_id in json request and db

Comment thread tests/test_bot.py
for _ in range(10)]
)
for item in create_many:
assert item.status_code == 200

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, need to check inside db

Comment thread tests/test_bot.py Outdated
nickname=nickname, load=load, max_load=max_load
)
await query.update(updated_bot)
await query.commit()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can commit after for loop

Comment thread tests/test_bot.py Outdated
id = bot.dict()["id"]
print(id)
await query.delete(id_=id)
await query.commit()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check her also in db we don not have records

@Irishery

Irishery commented Feb 22, 2022

Copy link
Copy Markdown
Author

next commit will be with adaptation to new changes in main (today-tomorrow)

Comment thread app/features/twitch/api.py Outdated
):
bot: Bot = await query.create(bot_in)
await query.commit()
fetch_content.delay(bot.id)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove for bot, we don't have any background tasks yet

Comment thread app/features/__init__.py Outdated
content = providers.Container(
ContentContainer, resources=resources, config=config.content
)
bot = providers.Container(

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be twitch container -> and inside twitch container you can make bot, and channel containers for query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants