Skip to content
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

function get_daily() not working. When Moving the GameVersion over to 2.2 the API Breaks #207

Open
CallocGD opened this issue Jul 29, 2024 · 2 comments

Comments

@CallocGD
Copy link

Here's the steps to reproduce this bug

Step 1

pip install gd.py aiounittest

Step 2

# test.py
import aiounittest
import unittest
import gd


class TestDaily(aiounittest.AsyncTestCase):
    
    @property
    def client(self) -> gd.Client:
        if not hasattr(self, "_client"):
            self._client = gd.Client()
        return self._client

    async def test_get_daily(self):
        daily = await self.client.get_daily()

# This was my idea to try and fix the problem it got the level but failed to parse it.
class TestDailyWith22(aiounittest.AsyncTestCase):
    @property
    def client(self) -> gd.Client:
        if not hasattr(self, "_client"):
            self._client = gd.Client(session=gd.Session(http=gd.HTTPClient(game_version=GameVersion(2,2), binary_version=RobTopVersion(4, 0))))
        return self._client

    async def test_get_daily(self):
        await self.client.get_daily()




if __name__ == "__main__":
    unittest.main()

Step 3

python test.py

If all was done correctly it throws this error no matter what even if there is supposed to be a new daily level out it still breaks. I cannot seem to decipher what was programmed for parsing the level data but even when moving the GameVersion to 2.2 it says it cannot parse the list of numbers and merely assumes it's an integer when it's not.
gd.errors.MissingAccess: can not get level with ID: -1

@CallocGD CallocGD changed the title function get_daily() not working. When Moving and when moving the GameVersion over to 2.2 the API Breaks function get_daily() not working. When Moving the GameVersion over to 2.2 the API Breaks Jul 29, 2024
@CallocGD
Copy link
Author

@nekitdev I would also recommend you write a test-suite for gdpy as well as that you'll able to easily verify if or when something fails, however if you do not have the time to do so I would be more than happy to write more of these test-cases so that you will be able to confirm and fix these mistakes more easily.

@CallocGD
Copy link
Author

Also I am using python 3.9.18 so this testcase should work on most versions if not all of the supported versions of python.

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

No branches or pull requests

1 participant