-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Brings us up to 3 failed, 56 passed, 57 warnings (original: 19 failed, 39 passed, 52 warnings)
- Loading branch information
Showing
6 changed files
with
45 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[pytest] | ||
asyncio_mode = auto | ||
markers = | ||
meta: mark a test as meta | ||
slow: mark a test as sssslllooowwww | ||
ircv3: mark a test as related to v3 of the IRC standard | ||
unit: mark a test as relating to the unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,23 +14,23 @@ def test_client_same_nick(server, client): | |
|
||
@pytest.mark.asyncio | ||
@with_client() | ||
def test_user_creation(server, client): | ||
client._create_user("WiZ") | ||
async def test_user_creation(server, client): | ||
await client._create_user("WiZ") | ||
assert "WiZ" in client.users | ||
assert client.users["WiZ"]["nickname"] == "WiZ" | ||
|
||
|
||
@pytest.mark.asyncio | ||
@with_client() | ||
def test_user_invalid_creation(server, client): | ||
client._create_user("irc.fbi.gov") | ||
async def test_user_invalid_creation(server, client): | ||
await client._create_user("irc.fbi.gov") | ||
assert "irc.fbi.gov" not in client.users | ||
|
||
|
||
@pytest.mark.asyncio | ||
@with_client() | ||
async def test_user_renaming(server, client): | ||
client._create_user("WiZ") | ||
await client._create_user("WiZ") | ||
await client._rename_user("WiZ", "jilles") | ||
|
||
assert "WiZ" not in client.users | ||
|
@@ -59,7 +59,7 @@ async def test_user_renaming_invalid_creation(server, client): | |
@pytest.mark.asyncio | ||
@with_client() | ||
async def test_user_renaming_channel_users(server, client): | ||
client._create_user("WiZ") | ||
await client._create_user("WiZ") | ||
client._create_channel("#lobby") | ||
client.channels["#lobby"]["users"].add("WiZ") | ||
|
||
|
@@ -70,18 +70,18 @@ async def test_user_renaming_channel_users(server, client): | |
|
||
@pytest.mark.asyncio | ||
@with_client() | ||
def test_user_deletion(server, client): | ||
client._create_user("WiZ") | ||
async def test_user_deletion(server, client): | ||
await client._create_user("WiZ") | ||
client._destroy_user("WiZ") | ||
|
||
assert "WiZ" not in client.users | ||
|
||
|
||
@pytest.mark.asyncio | ||
@with_client() | ||
def test_user_channel_deletion(server, client): | ||
async def test_user_channel_deletion(server, client): | ||
client._create_channel("#lobby") | ||
client._create_user("WiZ") | ||
await client._create_user("WiZ") | ||
client.channels["#lobby"]["users"].add("WiZ") | ||
|
||
client._destroy_user("WiZ", "#lobby") | ||
|
@@ -91,10 +91,10 @@ def test_user_channel_deletion(server, client): | |
|
||
@pytest.mark.asyncio | ||
@with_client() | ||
def test_user_channel_incomplete_deletion(server, client): | ||
async def test_user_channel_incomplete_deletion(server, client): | ||
client._create_channel("#lobby") | ||
client._create_channel("#foo") | ||
client._create_user("WiZ") | ||
await client._create_user("WiZ") | ||
client.channels["#lobby"]["users"].add("WiZ") | ||
client.channels["#foo"]["users"].add("WiZ") | ||
|
||
|
@@ -106,7 +106,7 @@ def test_user_channel_incomplete_deletion(server, client): | |
@pytest.mark.asyncio | ||
@with_client() | ||
async def test_user_synchronization(server, client): | ||
client._create_user("WiZ") | ||
await client._create_user("WiZ") | ||
await client._sync_user("WiZ", {"hostname": "og.irc.developer"}) | ||
|
||
assert client.users["WiZ"]["hostname"] == "og.irc.developer" | ||
|
@@ -129,14 +129,14 @@ async def test_user_invalid_synchronization(server, client): | |
@pytest.mark.asyncio | ||
@with_client() | ||
async def test_user_mask_format(server, client): | ||
client._create_user("WiZ") | ||
await client._create_user("WiZ") | ||
assert client._format_user_mask("WiZ") == "WiZ!*@*" | ||
|
||
await client._sync_user("WiZ", {"username": "wiz"}) | ||
assert client._format_user_mask("WiZ") == "WiZ!wiz@*" | ||
|
||
client._sync_user("WiZ", {"hostname": "og.irc.developer"}) | ||
await client._sync_user("WiZ", {"hostname": "og.irc.developer"}) | ||
assert client._format_user_mask("WiZ") == "[email protected]" | ||
|
||
client._sync_user("WiZ", {"username": None}) | ||
await client._sync_user("WiZ", {"username": None}) | ||
assert client._format_user_mask("WiZ") == "WiZ!*@og.irc.developer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
test_misc.py ~ Testing of Misc. Functions | ||
Designed for those simple functions that don't need their own dedicated test files | ||
But we want to hit them anyways | ||
""" | ||
from pydle.protocol import identifierify | ||
|
||
|
||
async def test_identifierify(): | ||
good_name = identifierify("MyVerySimpleName") | ||
bad_name = identifierify("I'mASpec!äl/Name!_") | ||
assert good_name == "myverysimplename" | ||
assert bad_name == "i_maspec__l_name__" |