Skip to content

Commit

Permalink
rejoin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
onerandomusername committed Jun 24, 2023
1 parent cb0085e commit 2710a68
Showing 1 changed file with 23 additions and 59 deletions.
82 changes: 23 additions & 59 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,32 @@ def test_resolve_template(url, expected) -> None:
"hi a aaa\npy x uwu y",
r"\*hi\* \~\~a\~ \|aaa\~\*\\\`\`" "\n" r"\`py x\`\`\` \_\_uwu\_\_ y",
),
(
r"## disnake",
"disnake",
r"\#\# disnake",
),
(
r"""Inside is a long list of why markdown is an amazing tool
- markdown supports lists
- honestly its a great tool that markdown supports said lists
- this is wrong but uh we'll get to that
""",
r"""Inside is a long list of why markdown is an amazing tool
markdown supports lists
honestly its a great tool that markdown supports said lists
this is wrong but uh we'll get to that
""",
r"""Inside is a long list of why markdown is an amazing tool
\- markdown supports lists
\- honestly its a great tool that markdown supports said lists
\- this is wrong but uh we'll get to that
""",
),
(
"aaaaa\n> h\n>> abc \n>>> te*st_",
"aaaaa\nh\n>> abc \ntest",
"aaaaa\n\\> h\n>> abc \n\\>>> te\\*st\\_",
"aaaaa\n\\> h\n>> abc \n\\>\\>\\> te\\*st\\_",
),
(
"*h*\n> [li|nk](~~url~~) xyz **https://google.com/stuff?uwu=owo",
Expand Down Expand Up @@ -515,64 +537,6 @@ def test_markdown_links(text: str, expected, expected_ignore) -> None:
assert utils.remove_markdown(text, ignore_links=True) == expected_ignore


@pytest.mark.parametrize(
("text", "expected"),
[
(
r"# disnake",
r"disnake",
),
(
r"## woah this should be removed\n ### but not this one",
r"woah this should be removed\n ### but not this one",
),
(
r"""Inside is a long list of why markdown is an amazing tool
- markdown supports lists
- honestly its a great tool that markdown supports said lists
- this is wrong but uh we'll get to that
""",
r"""Inside is a long list of why markdown is an amazing tool
markdown supports lists
honestly its a great tool that markdown supports said lists
this is wrong but uh we'll get to that
""",
),
],
)
def test_remove_markdown(text: str, expected: str) -> None:
assert utils.remove_markdown(text) == expected


@pytest.mark.parametrize(
("text", "expected"),
[
(
r"# disnake",
r"\# disnake",
),
(
"## escape these quotes\n ### but not these",
"\\#\\# escape these quotes\n ### but not these",
),
(
r"""Inside is a long list of why markdown is an amazing tool
- markdown supports lists
- honestly its a great tool that markdown supports said lists
- this is wrong but uh we'll get to that
""",
r"""Inside is a long list of why markdown is an amazing tool
\- markdown supports lists
\- honestly its a great tool that markdown supports said lists
\- this is wrong but uh we'll get to that
""",
),
],
)
def test_escape_markdown(text: str, expected: str) -> None:
assert utils.escape_markdown(text) == expected


@pytest.mark.parametrize(
("text", "expected"),
[
Expand Down

0 comments on commit 2710a68

Please sign in to comment.