Skip to content

Commit

Permalink
Add: 3 Test With Auth
Browse files Browse the repository at this point in the history
  • Loading branch information
faridrasidov committed Jul 27, 2024
1 parent 4cb2105 commit ea58f98
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from soundcld.resource.user import User, BasicUser, MissingUser
from soundcld.resource.track import Track, BasicTrack, MiniTrack
from soundcld.resource.playlist_album import AlbumPlaylist, BasicAlbumPlaylist
from soundcld.resource.webprofiles import WebProfile
from soundcld.resource.aliases import SearchItem
from soundcld.resource.comments import BasicComment, Comment
from soundcld.resource.webprofile import WebProfile
from soundcld.resource.alias import SearchItem
from soundcld.resource.comment import BasicComment, Comment
from soundcld.resource.message import Message
from soundcld.resource.conversation import Conversation
31 changes: 31 additions & 0 deletions tests/test_api_conversation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import pytest
from soundcld.api_handler import SoundCloud
from data_types import *

@pytest.fixture
def soundcloud_client():
user_id = 513663489
client = SoundCloud(auth=True)
return client, user_id

def test_get_my_conversations_thumb(soundcloud_client):
client, user_id = soundcloud_client
conversation_thumbs = client.get_my_conversations_thumb()
for conversation in conversation_thumbs:
assert isinstance(conversation, Conversation)

def test_get_my_unread_conversations(soundcloud_client):
client, user_id = soundcloud_client
conversation_unread = client.get_my_unread_conversations()
for conversation in conversation_unread:
assert isinstance(conversation, Conversation)

def test_get_my_user_conversation(soundcloud_client):
client, user_id = soundcloud_client
conversation_messages = client.get_my_user_conversation(user_id)
for message in conversation_messages:
assert isinstance(message, Message)


if __name__ == '__main__':
pytest.main()

0 comments on commit ea58f98

Please sign in to comment.