Skip to content

stats.add_battle tests #331

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

Closed
wants to merge 20 commits into from
Closed

stats.add_battle tests #331

wants to merge 20 commits into from

Conversation

Patch85
Copy link

@Patch85 Patch85 commented Aug 10, 2025

tests(stats): add new add_battle tests

  • Adds 2 new test files for the stats add_battle method, representing
    graph-based as well as input-partitioning approaches.
  • two test cases in battle_test fail as the truthy value of non
    boolean input values results in unintuitive output

Copy link
Owner

@lxgr-linux lxgr-linux left a comment

Choose a reason for hiding this comment

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

Hey there, this is really cool since I normaly don't really come around to testing a whole lot.

@@ -0,0 +1,12 @@
{
Copy link
Owner

Choose a reason for hiding this comment

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

I would recomment not to commit IDE configurations

Copy link
Author

Choose a reason for hiding this comment

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

Hello! I apologize for the mess here, it was my sleepy error. I am working with a group of fellow Penn State grad students on a project where we were asked to find an open source project to analyze and produce some tests for. We settled on Pokete as an interesting option and what you're seeing was my inadvertently misdirected PR from our fork for the purposes of the assignment (I did not look closely enough at which repository and branch the PR was being created for in the GitHub interface). We discussed from the get-go that we'd like to contribute back to your project, but this PR should not have been the one to do so (as you have already seen, it contains things like our vs code config, etc.) I would love to replace this one with a another, along with some other suggested updates we came across. I for one, have really enjoyed diving into your game

Copy link
Owner

Choose a reason for hiding this comment

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

Hello, I feel really flattered and I'm glad to hear that.
Sure, just submit another PR later.

@@ -61,6 +61,9 @@ def __init__(
self.night_active = self.inf.night_active
self.enem = None
self.oldhp = 0
# don't allow pokete with negative xp
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe this should be changed to an assertion like in bank

mock_get_terminal_size.return_value = (140, 40)
from pokete.figure.bank import Bank

class bank_test(unittest.TestCase):
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
class bank_test(unittest.TestCase):
class BankTest(unittest.TestCase):

Like in the other test files class naming should be in upper camel case and method naming in snake case.

@@ -0,0 +1,111 @@
import unittest
Copy link
Owner

Choose a reason for hiding this comment

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

Since you moved this from semantic_version.py maybe the old file should be removed.

from .poke_graph_test import *
from .poke_test import *
from .bank_test import *
from .stats import *
Copy link
Owner

Choose a reason for hiding this comment

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

Also tests fail due to this, this should rather be .battle_graph_test

- Adds 2 new test files for the stats add_battle method, representing
  graph-based as well as input-partitioning approaches.
- two test cases in battle_test fail as the truthy value of non
  boolean input values results in unintuitive output
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.

4 participants