Skip to content

Add beatmap tests + __repr__() method for objects#7

Merged
Sheppsu merged 22 commits intoSheppsu:mainfrom
descensiontohell:main
Aug 4, 2022
Merged

Add beatmap tests + __repr__() method for objects#7
Sheppsu merged 22 commits intoSheppsu:mainfrom
descensiontohell:main

Conversation

@descensiontohell
Copy link
Copy Markdown
Contributor

(needs a review)

  • Gives each object in osu/objects a __repr__() method that utilizes prettify() function to display the class name of the object and some attributes specified as params
    as
    User(username='nouvelle', id=6943941)
    Beatmap(version="Bonzphyxia's Extra", beatmapset=Beatmapset(artist='USAO', title='Night sky', creator='sukiNathan'))

  • Adds auto tests for API methods based on pytest and the corresponding fixtures (only beatmap tests provided yet)

Running tests:

  1. Fill the credentials in pytest_tests/constants.py
  2. Run pytest pytest_tests

I'm not sure if having pytest in requirements.txt will make users obtain that package on osu.py installation (it shouldn't happen since pytest is only used for dev purpose)

@descensiontohell descensiontohell marked this pull request as ready for review August 3, 2022 14:03
Comment thread osu/objects/news.py
Comment thread osu/objects/user.py
@descensiontohell
Copy link
Copy Markdown
Contributor Author

something broke again in tests, need to investigate

@descensiontohell
Copy link
Copy Markdown
Contributor Author

apparently it's in new parse_enum_args() method so I recommend merging that and then fix the method based on tests

@Sheppsu Sheppsu merged commit ada9267 into Sheppsu:main Aug 4, 2022
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