[PR #266] [MERGED] Fix authenticated tests #357

Closed
opened 2026-02-27 20:24:24 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/266
Author: @marioortizmanero
Created: 10/11/2021
Status: Merged
Merged: 10/12/2021
Merged by: @ramsayleung

Base: fix-exampleHead: fix-tests


📝 Commits (4)

📊 Changes

5 files changed (+91 additions, -29 deletions)

View changed files

📝 rspotify-model/src/idtypes.rs (+77 -20)
📝 src/clients/base.rs (+1 -1)
📝 src/clients/oauth.rs (+1 -1)
📝 tests/test_models.rs (+10 -5)
📝 tests/test_with_oauth.rs (+2 -2)

📄 Description

Description

I forgot we should run the authenticated tests manually before the release! Turns out we have a few bugs:

  • User IDs can have any kind of character, including underscores. someone_nice is a valid username, but it's not made entirely of alphanumeric characters, so with the default implementation it wouldn't parse. Thus, I've implemented UserId manually. This made search_playlist fail.
  • The debug_assert for the volume endpoint was wrong, so its test failed.
  • The playlist test failed because its call to playlist_remove_specific_occurrences_of_items was wrong, and the playlist_check_follow debug_assert was wrong as well.

I've had to write these patches over the fix-example branch for #265, so I would suggest to review that before merging this.

Motivation and Context

None

Dependencies

None

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

The playlist_search, volume, and playlist tests in tests/test_with_oauth.rs now work.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ramsayleung/rspotify/pull/266 **Author:** [@marioortizmanero](https://github.com/marioortizmanero) **Created:** 10/11/2021 **Status:** ✅ Merged **Merged:** 10/12/2021 **Merged by:** [@ramsayleung](https://github.com/ramsayleung) **Base:** `fix-example` ← **Head:** `fix-tests` --- ### 📝 Commits (4) - [`9afb69e`](https://github.com/ramsayleung/rspotify/commit/9afb69e3813ca7e890a526bb8b9c03656efa39e1) Fix silly volume debug_assert - [`48a962b`](https://github.com/ramsayleung/rspotify/commit/48a962b6d3c6cd25aac6ee0e1276884beba4113b) Fix UserId - [`0726d80`](https://github.com/ramsayleung/rspotify/commit/0726d808db69442882f45986526c87e5b0aeb74b) Merge branch 'fix-example' into fix-tests - [`8b0ea4a`](https://github.com/ramsayleung/rspotify/commit/8b0ea4a97286461eafb0937ed223ea413a9581a1) Fix test_playlist ### 📊 Changes **5 files changed** (+91 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `rspotify-model/src/idtypes.rs` (+77 -20) 📝 `src/clients/base.rs` (+1 -1) 📝 `src/clients/oauth.rs` (+1 -1) 📝 `tests/test_models.rs` (+10 -5) 📝 `tests/test_with_oauth.rs` (+2 -2) </details> ### 📄 Description ## Description I forgot we should run the authenticated tests manually before the release! Turns out we have a few bugs: * User IDs can have any kind of character, including underscores. `someone_nice` is a valid username, but it's not made entirely of _alphanumeric_ characters, so with the default implementation it wouldn't parse. Thus, I've implemented `UserId` manually. This made `search_playlist` fail. * The `debug_assert` for the `volume` endpoint was wrong, so its test failed. * The `playlist` test failed because its call to `playlist_remove_specific_occurrences_of_items` was wrong, and the `playlist_check_follow` debug_assert was wrong as well. I've had to write these patches over the `fix-example` branch for #265, so I would suggest to review that before merging this. ## Motivation and Context None ## Dependencies None ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] This change requires a documentation update ## How Has This Been Tested? The `playlist_search`, `volume`, and `playlist` tests in `tests/test_with_oauth.rs` now work. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:24:24 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#357
No description provided.