import pydle
from .fixtures import with_client


@with_client()
def test_client_same_channel(server, client):
    assert client.is_same_channel('#lobby', '#lobby')
    assert not client.is_same_channel('#lobby', '#support')
    assert not client.is_same_channel('#lobby', 'jilles')

@with_client()
def test_channel_creation(server, client):
    client._create_channel('#pydle')
    assert '#pydle' in client.channels
    assert client.channels['#pydle']['users'] == set()

@with_client()
def test_channel_destruction(server, client):
    client._create_channel('#pydle')
    client._destroy_channel('#pydle')
    assert '#pydle' not in client.channels

@with_client()
def test_channel_user_destruction(server, client):
    client._create_channel('#pydle')
    client._create_user('WiZ')
    client.channels['#pydle']['users'].add('WiZ')

    client._destroy_channel('#pydle')
    assert '#pydle' not in client.channels
    assert 'WiZ' not in client.users

@@ -276,16 +276,357 @@
 lles')%0A%0A
+@with_client()%0Adef test_client_in_channel(server, client):%0A    client._create_channel('#lobby')%0A    assert client.in_channel('#lobby')%0A%0A@with_client()%0Adef test_client_is_channel(server, client):%0A    # Test always true...%0A    assert client.is_channel('#lobby')%0A    assert client.is_channel('WiZ')%0A    assert client.is_channel('irc.fbi.gov')%0A%0A
 @with_cl

Add is_channel/in_channel tests.