-
Notifications
You must be signed in to change notification settings - Fork 1
Crud test #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Crud test #1
Conversation
tests/test_bot.py
Outdated
| "client_id": "client123", "nickname": "Cooper123"}) | ||
| assert create_one.status_code == 200 | ||
|
|
||
| query = await container.bot.query() |
There was a problem hiding this comment.
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
| for _ in range(10)] | ||
| ) | ||
| for item in create_many: | ||
| assert item.status_code == 200 |
There was a problem hiding this comment.
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
tests/test_bot.py
Outdated
| nickname=nickname, load=load, max_load=max_load | ||
| ) | ||
| await query.update(updated_bot) | ||
| await query.commit() |
There was a problem hiding this comment.
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
tests/test_bot.py
Outdated
| id = bot.dict()["id"] | ||
| print(id) | ||
| await query.delete(id_=id) | ||
| await query.commit() |
There was a problem hiding this comment.
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
|
next commit will be with adaptation to new changes in main (today-tomorrow) |
app/features/twitch/api.py
Outdated
| ): | ||
| bot: Bot = await query.create(bot_in) | ||
| await query.commit() | ||
| fetch_content.delay(bot.id) |
There was a problem hiding this comment.
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
app/features/__init__.py
Outdated
| content = providers.Container( | ||
| ContentContainer, resources=resources, config=config.content | ||
| ) | ||
| bot = providers.Container( |
There was a problem hiding this comment.
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
Set db and added tests for bot