-
Notifications
You must be signed in to change notification settings - Fork 2
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
Generates cards stats after payment step #170
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
de88186
Generates cards stats after payment step
austinpray d07aa23
Update kaori/plugins/gacha/commands/display.py
austinpray 6d24a76
Merge remote-tracking branch 'origin/master' into 168-stats
austinpray dd4dc3a
Merge branch 'master' into 168-stats
austinpray f17d015
Merge branch 'master' into 168-stats
austinpray 356203c
Merge branch 'master' into 168-stats
austinpray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,14 @@ | |
from time import time | ||
from unittest.mock import Mock, MagicMock | ||
|
||
from kaori.plugins.gacha.engine import RarityName | ||
from slackclient import SlackClient | ||
from sqlalchemy import create_engine | ||
from sqlalchemy.orm import sessionmaker, Session | ||
from sqlalchemy.orm import sessionmaker | ||
|
||
import kaori.plugins.gacha as gacha_plugin | ||
from kaori import test_config | ||
from kaori.adapters.slack import SlackAdapter | ||
from kaori.plugins.gacha.engine import RarityName | ||
from kaori.plugins.gacha.models.Card import Card | ||
from kaori.plugins.users import User | ||
from kaori.skills import DB, LocalFileUploader | ||
|
@@ -33,7 +33,7 @@ def test_rarity_extract(): | |
assert user_extract_rarity("I'm thinking a S-tier card") is RarityName.S | ||
|
||
|
||
def test_card_creation_state_happy(): | ||
def test_card_creation_state_happy(make_fake_user, grant_kkreds): | ||
config = test_config | ||
db_engine = create_engine(config.DATABASE_URL) | ||
make_session = sessionmaker(bind=db_engine, autoflush=False) | ||
|
@@ -63,16 +63,11 @@ def test_card_creation_state_happy(): | |
gacha_plugin, | ||
} | ||
|
||
slack_id = token_hex(5) | ||
u: User = make_fake_user() | ||
slack_id = u.slack_id | ||
user_id = u.id | ||
|
||
session: Session | ||
with db.session_scope() as session: | ||
u = User(name='Ridwan', | ||
slack_id=slack_id, | ||
api_key=token_hex(5)) | ||
session.add(u) | ||
session.commit() | ||
user_id = u.id | ||
# grant_kkreds(u, 1e10) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when I make S-tier cards this test will fail until this is uncommented |
||
|
||
def handle(msg): | ||
k.handle('slack', msg) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
will be useful to testing payment later