Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion slackclient/_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def __init__(self, server, name, channel_id, members=None):
self.members = [] if members is None else members

def __eq__(self, compare_str):
if self.name == compare_str or self.name == "#" + compare_str or self.id == compare_str:
if self.name == compare_str or "#" + self.name == compare_str or self.id == compare_str:
return True
else:
return False
Expand Down
14 changes: 12 additions & 2 deletions tests/test_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@
import pytest


def test_Channel(channel):
def test_channel(channel):
assert type(channel) == Channel

def test_channel_eq(channel):
channel = Channel(
'test-server',
'test-channel',
'C12345678',
)
assert channel == 'test-channel'
assert channel == '#test-channel'
assert channel == 'C12345678'
assert (channel == 'foo') is False

@pytest.mark.xfail
def test_Channel_send_message(channel):
def test_channel_send_message(channel):
channel.send_message('hi')