mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-21 08:42:32 -05:00
Make some dependency changes, support Python 3.10 and 3.11 (#5611)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -65,7 +65,6 @@ ancestor_rev = "c950fc05a540dd76b944719c2a3302da2e2f3090"
|
||||
descendant_rev = "fb99eb7d2d5bed514efc98fe6686b368f8425745"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"maybe_ancestor_rev,descendant_rev,returncode,expected",
|
||||
[(ancestor_rev, descendant_rev, 0, True), (descendant_rev, ancestor_rev, 1, False)],
|
||||
@@ -86,7 +85,6 @@ async def test_is_ancestor(mocker, repo, maybe_ancestor_rev, descendant_rev, ret
|
||||
assert ret is expected
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_is_ancestor_object_raise(mocker, repo):
|
||||
m = _mock_run(mocker, repo, 128, b"", b"fatal: Not a valid object name invalid1")
|
||||
with pytest.raises(UnknownRevision):
|
||||
@@ -104,7 +102,6 @@ async def test_is_ancestor_object_raise(mocker, repo):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_is_ancestor_commit_raise(mocker, repo):
|
||||
m = _mock_run(
|
||||
mocker,
|
||||
@@ -130,7 +127,6 @@ async def test_is_ancestor_commit_raise(mocker, repo):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_file_update_statuses(mocker, repo):
|
||||
old_rev = "c950fc05a540dd76b944719c2a3302da2e2f3090"
|
||||
new_rev = "fb99eb7d2d5bed514efc98fe6686b368f8425745"
|
||||
@@ -160,7 +156,6 @@ async def test_get_file_update_statuses(mocker, repo):
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_is_module_modified(mocker, repo):
|
||||
old_rev = "c950fc05a540dd76b944719c2a3302da2e2f3090"
|
||||
new_rev = "fb99eb7d2d5bed514efc98fe6686b368f8425745"
|
||||
@@ -184,7 +179,6 @@ async def test_is_module_modified(mocker, repo):
|
||||
assert ret is True
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_full_sha1_success(mocker, repo):
|
||||
commit = "c950fc05a540dd76b944719c2a3302da2e2f3090"
|
||||
m = _mock_run(mocker, repo, 0, commit.encode())
|
||||
@@ -196,7 +190,6 @@ async def test_get_full_sha1_success(mocker, repo):
|
||||
assert ret == commit
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_full_sha1_notfound(mocker, repo):
|
||||
m = _mock_run(mocker, repo, 128, b"", b"fatal: Needed a single revision")
|
||||
with pytest.raises(UnknownRevision):
|
||||
@@ -206,7 +199,6 @@ async def test_get_full_sha1_notfound(mocker, repo):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_full_sha1_ambiguous(mocker, repo):
|
||||
m = _mock_run(
|
||||
mocker,
|
||||
@@ -246,7 +238,6 @@ def test_update_available_modules(repo):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_checkout(mocker, repo):
|
||||
commit = "c950fc05a540dd76b944719c2a3302da2e2f3090"
|
||||
m = _mock_run(mocker, repo, 0)
|
||||
@@ -261,7 +252,6 @@ async def test_checkout(mocker, repo):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_checkout_ctx_manager(mocker, repo):
|
||||
commit = "c950fc05a540dd76b944719c2a3302da2e2f3090"
|
||||
m = mocker.patch.object(repo, "_checkout", autospec=True, return_value=None)
|
||||
@@ -273,7 +263,6 @@ async def test_checkout_ctx_manager(mocker, repo):
|
||||
m.assert_called_with(old_commit, force_checkout=False)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_checkout_await(mocker, repo):
|
||||
commit = "c950fc05a540dd76b944719c2a3302da2e2f3090"
|
||||
m = mocker.patch.object(repo, "_checkout", autospec=True, return_value=None)
|
||||
@@ -282,7 +271,6 @@ async def test_checkout_await(mocker, repo):
|
||||
m.assert_called_once_with(commit, force_checkout=False)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_clone_with_branch(mocker, repo):
|
||||
branch = repo.branch = "dont_add_commits"
|
||||
commit = "a0ccc2390883c85a361f5a90c72e1b07958939fa"
|
||||
@@ -300,7 +288,6 @@ async def test_clone_with_branch(mocker, repo):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_clone_without_branch(mocker, repo):
|
||||
branch = "dont_add_commits"
|
||||
commit = "a0ccc2390883c85a361f5a90c72e1b07958939fa"
|
||||
@@ -318,7 +305,6 @@ async def test_clone_without_branch(mocker, repo):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_update(mocker, repo):
|
||||
old_commit = repo.commit
|
||||
new_commit = "a0ccc2390883c85a361f5a90c72e1b07958939fa"
|
||||
@@ -335,7 +321,6 @@ async def test_update(mocker, repo):
|
||||
# old tests
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_add_repo(monkeypatch, repo_manager):
|
||||
monkeypatch.setattr("redbot.cogs.downloader.repo_manager.Repo._run", fake_run_noprint)
|
||||
monkeypatch.setattr(
|
||||
@@ -349,7 +334,6 @@ async def test_add_repo(monkeypatch, repo_manager):
|
||||
assert squid.available_modules == ()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_lib_install_requirements(monkeypatch, library_installable, repo, tmpdir):
|
||||
monkeypatch.setattr("redbot.cogs.downloader.repo_manager.Repo._run", fake_run_noprint)
|
||||
monkeypatch.setattr(
|
||||
@@ -368,7 +352,6 @@ async def test_lib_install_requirements(monkeypatch, library_installable, repo,
|
||||
assert len(failed) == 0
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_remove_repo(monkeypatch, repo_manager):
|
||||
monkeypatch.setattr("redbot.cogs.downloader.repo_manager.Repo._run", fake_run_noprint)
|
||||
monkeypatch.setattr(
|
||||
@@ -383,7 +366,6 @@ async def test_remove_repo(monkeypatch, repo_manager):
|
||||
assert repo_manager.get_repo("squid") is None
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_existing_repo(mocker, repo_manager):
|
||||
repo_manager.does_repo_exist = mocker.MagicMock(return_value=True)
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ from redbot.pytest.downloader import (
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_clone_nobranch(git_repo, tmp_path):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -25,7 +24,6 @@ async def test_git_clone_nobranch(git_repo, tmp_path):
|
||||
assert p.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_clone_branch(git_repo, tmp_path):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -38,7 +36,6 @@ async def test_git_clone_branch(git_repo, tmp_path):
|
||||
assert p.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_clone_non_existent_branch(git_repo, tmp_path):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -51,7 +48,6 @@ async def test_git_clone_non_existent_branch(git_repo, tmp_path):
|
||||
assert p.returncode == 128
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_clone_notgit_repo(git_repo, tmp_path):
|
||||
notgit_repo = tmp_path / "test_clone_folder"
|
||||
p = await git_repo._run(
|
||||
@@ -62,7 +58,6 @@ async def test_git_clone_notgit_repo(git_repo, tmp_path):
|
||||
assert p.returncode == 128
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_current_branch_master(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(git_repo.GIT_CURRENT_BRANCH, path=git_repo.folder_path)
|
||||
@@ -71,7 +66,6 @@ async def test_git_current_branch_master(git_repo):
|
||||
assert p.stdout.decode().strip() == "master"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_current_branch_detached(git_repo):
|
||||
await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -87,7 +81,6 @@ async def test_git_current_branch_detached(git_repo):
|
||||
assert p.stderr.decode().strip() == "fatal: ref HEAD is not a symbolic ref"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_current_commit_on_branch(git_repo):
|
||||
# HEAD on dont_add_commits (a0ccc2390883c85a361f5a90c72e1b07958939fa)
|
||||
# setup
|
||||
@@ -105,7 +98,6 @@ async def test_git_current_commit_on_branch(git_repo):
|
||||
assert p.stdout.decode().strip() == "a0ccc2390883c85a361f5a90c72e1b07958939fa"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_current_commit_detached(git_repo):
|
||||
# detached HEAD state (c950fc05a540dd76b944719c2a3302da2e2f3090)
|
||||
await git_repo._run(
|
||||
@@ -122,7 +114,6 @@ async def test_git_current_commit_detached(git_repo):
|
||||
assert p.stdout.decode().strip() == "c950fc05a540dd76b944719c2a3302da2e2f3090"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_latest_commit(git_repo):
|
||||
# HEAD on dont_add_commits (a0ccc2390883c85a361f5a90c72e1b07958939fa)
|
||||
p = await git_repo._run(
|
||||
@@ -134,7 +125,6 @@ async def test_git_latest_commit(git_repo):
|
||||
assert p.stdout.decode().strip() == "a0ccc2390883c85a361f5a90c72e1b07958939fa"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_hard_reset(cloned_git_repo, tmp_path):
|
||||
staged_file = cloned_git_repo.folder_path / "staged_file.txt"
|
||||
staged_file.touch()
|
||||
@@ -150,7 +140,6 @@ async def test_git_hard_reset(cloned_git_repo, tmp_path):
|
||||
assert staged_file.exists() is False
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_pull(git_repo_with_remote, tmp_path):
|
||||
# setup
|
||||
staged_file = Path(git_repo_with_remote.url) / "staged_file.txt"
|
||||
@@ -171,7 +160,6 @@ async def test_git_pull(git_repo_with_remote, tmp_path):
|
||||
assert (git_repo_with_remote.folder_path / "staged_file.txt").exists()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_diff_file_status(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -195,7 +183,6 @@ async def test_git_diff_file_status(git_repo):
|
||||
# might need to add test for test_git_log, but it's unused method currently
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_discover_remote_url(cloned_git_repo, tmp_path):
|
||||
p = await cloned_git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -206,7 +193,6 @@ async def test_git_discover_remote_url(cloned_git_repo, tmp_path):
|
||||
assert p.stdout.decode().strip() == cloned_git_repo.url
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_checkout_detached_head(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -218,7 +204,6 @@ async def test_git_checkout_detached_head(git_repo):
|
||||
assert p.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_checkout_branch(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -228,7 +213,6 @@ async def test_git_checkout_branch(git_repo):
|
||||
assert p.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_checkout_non_existent_branch(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -238,7 +222,6 @@ async def test_git_checkout_non_existent_branch(git_repo):
|
||||
assert p.returncode == 1
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_branch_name(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -249,7 +232,6 @@ async def test_git_get_full_sha1_from_branch_name(git_repo):
|
||||
assert p.stdout.decode().strip() == "a0ccc2390883c85a361f5a90c72e1b07958939fa"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_full_hash(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -262,7 +244,6 @@ async def test_git_get_full_sha1_from_full_hash(git_repo):
|
||||
assert p.stdout.decode().strip() == "c950fc05a540dd76b944719c2a3302da2e2f3090"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_short_hash(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -273,7 +254,6 @@ async def test_git_get_full_sha1_from_short_hash(git_repo):
|
||||
assert p.stdout.decode().strip() == "c950fc05a540dd76b944719c2a3302da2e2f3090"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_too_short_hash(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(git_repo.GIT_GET_FULL_SHA1, path=git_repo.folder_path, rev="c95")
|
||||
@@ -282,7 +262,6 @@ async def test_git_get_full_sha1_from_too_short_hash(git_repo):
|
||||
assert p.stderr.decode().strip() == "fatal: Needed a single revision"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_lightweight_tag(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -293,7 +272,6 @@ async def test_git_get_full_sha1_from_lightweight_tag(git_repo):
|
||||
assert p.stdout.decode().strip() == "fb99eb7d2d5bed514efc98fe6686b368f8425745"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_annotated_tag(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -304,7 +282,6 @@ async def test_git_get_full_sha1_from_annotated_tag(git_repo):
|
||||
assert p.stdout.decode().strip() == "a7120330cc179396914e0d6af80cfa282adc124b"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_invalid_ref(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -318,7 +295,6 @@ async def test_git_get_full_sha1_from_invalid_ref(git_repo):
|
||||
@pytest.mark.skipif(
|
||||
GIT_VERSION < (2, 31), reason="This is test for output from Git 2.31 and newer."
|
||||
)
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_ambiguous_commits(git_repo):
|
||||
# 2 ambiguous refs:
|
||||
# branch ambiguous_1 - 95da0b576271cb5bee5f3e075074c03ee05fed05
|
||||
@@ -341,7 +317,6 @@ async def test_git_get_full_sha1_from_ambiguous_commits(git_repo):
|
||||
@pytest.mark.skipif(
|
||||
GIT_VERSION < (2, 36), reason="This is test for output from Git 2.36 and newer."
|
||||
)
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_ambiguous_tag_and_commit(git_repo):
|
||||
# 2 ambiguous refs:
|
||||
# branch ambiguous_with_tag - c6f0e5ec04d99bdf8c6c78ff20d66d286eecb3ea
|
||||
@@ -364,7 +339,6 @@ async def test_git_get_full_sha1_from_ambiguous_tag_and_commit(git_repo):
|
||||
@pytest.mark.skipif(
|
||||
not ((2, 31) <= GIT_VERSION < (2, 36)), reason="This is test for output from Git >=2.31,<2.36."
|
||||
)
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_ambiguous_tag_and_commit_pre_2_36(git_repo):
|
||||
# 2 ambiguous refs:
|
||||
# branch ambiguous_with_tag - c6f0e5ec04d99bdf8c6c78ff20d66d286eecb3ea
|
||||
@@ -387,7 +361,6 @@ async def test_git_get_full_sha1_from_ambiguous_tag_and_commit_pre_2_36(git_repo
|
||||
@pytest.mark.skipif(
|
||||
GIT_VERSION >= (2, 31), reason="This is test for output from Git older than 2.31."
|
||||
)
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_ambiguous_commits_pre_2_31(git_repo):
|
||||
# 2 ambiguous refs:
|
||||
# branch ambiguous_1 - 95da0b576271cb5bee5f3e075074c03ee05fed05
|
||||
@@ -410,7 +383,6 @@ async def test_git_get_full_sha1_from_ambiguous_commits_pre_2_31(git_repo):
|
||||
@pytest.mark.skipif(
|
||||
GIT_VERSION >= (2, 31), reason="This is test for output from Git older than 2.31."
|
||||
)
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_get_full_sha1_from_ambiguous_tag_and_commit_pre_2_31(git_repo):
|
||||
# 2 ambiguous refs:
|
||||
# branch ambiguous_with_tag - c6f0e5ec04d99bdf8c6c78ff20d66d286eecb3ea
|
||||
@@ -430,7 +402,6 @@ async def test_git_get_full_sha1_from_ambiguous_tag_and_commit_pre_2_31(git_repo
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_is_ancestor_true(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -443,7 +414,6 @@ async def test_git_is_ancestor_true(git_repo):
|
||||
assert p.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_is_ancestor_false(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -456,7 +426,6 @@ async def test_git_is_ancestor_false(git_repo):
|
||||
assert p.returncode == 1
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_is_ancestor_invalid_object(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -470,7 +439,6 @@ async def test_git_is_ancestor_invalid_object(git_repo):
|
||||
assert p.stderr.decode().strip() == "fatal: Not a valid object name invalid1"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_is_ancestor_invalid_commit(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -486,7 +454,6 @@ async def test_git_is_ancestor_invalid_commit(git_repo):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_check_if_module_exists_true(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -502,7 +469,6 @@ async def test_git_check_if_module_exists_true(git_repo):
|
||||
@pytest.mark.skipif(
|
||||
GIT_VERSION < (2, 36), reason="This is test for output from Git 2.36 and newer."
|
||||
)
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_check_if_module_exists_false(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -521,7 +487,6 @@ async def test_git_check_if_module_exists_false(git_repo):
|
||||
@pytest.mark.skipif(
|
||||
GIT_VERSION >= (2, 36), reason="This is test for output from Git older than 2.31."
|
||||
)
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_check_if_module_exists_false_pre_2_36(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -537,7 +502,6 @@ async def test_git_check_if_module_exists_false_pre_2_36(git_repo):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_find_last_occurrence_existent(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
@@ -552,7 +516,6 @@ async def test_git_find_last_occurrence_existent(git_repo):
|
||||
assert p.stdout.decode().strip() == "a7120330cc179396914e0d6af80cfa282adc124b"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_git_find_last_occurrence_non_existent(git_repo):
|
||||
p = await git_repo._run(
|
||||
ProcessFormatter().format(
|
||||
|
||||
@@ -7,12 +7,10 @@ def test_is_valid_alias_name(alias):
|
||||
assert alias.is_valid_alias_name("not valid name") is False
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_empty_guild_aliases(alias, empty_guild):
|
||||
assert list(await alias._aliases.get_guild_aliases(empty_guild)) == []
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_empty_global_aliases(alias):
|
||||
assert list(await alias._aliases.get_global_aliases()) == []
|
||||
|
||||
@@ -25,7 +23,6 @@ async def create_test_global_alias(alias, ctx):
|
||||
await alias._aliases.add_alias(ctx, "test_global", "ping", global_=True)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_add_guild_alias(alias, ctx):
|
||||
await create_test_guild_alias(alias, ctx)
|
||||
|
||||
@@ -33,7 +30,6 @@ async def test_add_guild_alias(alias, ctx):
|
||||
assert alias_obj.name == "test"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_delete_guild_alias(alias, ctx):
|
||||
await create_test_guild_alias(alias, ctx)
|
||||
alias_obj = await alias._aliases.get_alias(ctx.guild, "test")
|
||||
@@ -46,7 +42,6 @@ async def test_delete_guild_alias(alias, ctx):
|
||||
assert alias_obj is None
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_add_global_alias(alias, ctx):
|
||||
await create_test_global_alias(alias, ctx)
|
||||
alias_obj = await alias._aliases.get_alias(ctx.guild, "test_global")
|
||||
@@ -54,7 +49,6 @@ async def test_add_global_alias(alias, ctx):
|
||||
assert alias_obj.name == "test_global"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_delete_global_alias(alias, ctx):
|
||||
await create_test_global_alias(alias, ctx)
|
||||
alias_obj = await alias._aliases.get_alias(ctx.guild, "test_global")
|
||||
|
||||
@@ -2,7 +2,6 @@ import pytest
|
||||
from redbot.pytest.economy import *
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_bank_register(bank, ctx):
|
||||
default_bal = await bank.get_default_balance(ctx.guild)
|
||||
assert default_bal == (await bank.get_account(ctx.author)).balance
|
||||
@@ -15,7 +14,6 @@ async def has_account(member, bank):
|
||||
await bank.set_balance(member, balance)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_bank_transfer(bank, member_factory):
|
||||
mbr1 = member_factory.get()
|
||||
mbr2 = member_factory.get()
|
||||
@@ -28,7 +26,6 @@ async def test_bank_transfer(bank, member_factory):
|
||||
assert bal2 + 50 == newbal2
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_bank_set(bank, member_factory):
|
||||
mbr = member_factory.get()
|
||||
await bank.set_balance(mbr, 250)
|
||||
@@ -36,7 +33,6 @@ async def test_bank_set(bank, member_factory):
|
||||
assert acc.balance == 250
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_bank_can_spend(bank, member_factory):
|
||||
mbr = member_factory.get()
|
||||
canspend = await bank.can_spend(mbr, 50)
|
||||
@@ -47,7 +43,6 @@ async def test_bank_can_spend(bank, member_factory):
|
||||
assert canspendnow
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_set_bank_name(bank, guild_factory):
|
||||
guild = guild_factory.get()
|
||||
await bank.set_bank_name("Test Bank", guild)
|
||||
@@ -55,7 +50,6 @@ async def test_set_bank_name(bank, guild_factory):
|
||||
assert name == "Test Bank"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_set_currency_name(bank, guild_factory):
|
||||
guild = guild_factory.get()
|
||||
await bank.set_currency_name("Coins", guild)
|
||||
@@ -63,7 +57,6 @@ async def test_set_currency_name(bank, guild_factory):
|
||||
assert name == "Coins"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_set_default_balance(bank, guild_factory):
|
||||
guild = guild_factory.get()
|
||||
await bank.set_default_balance(500, guild)
|
||||
@@ -71,7 +64,6 @@ async def test_set_default_balance(bank, guild_factory):
|
||||
assert default_bal == 500
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_nonint_transaction_amount(bank, member_factory):
|
||||
mbr1 = member_factory.get()
|
||||
mbr2 = member_factory.get()
|
||||
|
||||
@@ -3,14 +3,12 @@ import pytest
|
||||
from redbot.pytest.mod import *
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_modlog_register_casetype(mod):
|
||||
ct = {"name": "ban", "default_setting": True, "image": ":hammer:", "case_str": "Ban"}
|
||||
casetype = await mod.register_casetype(**ct)
|
||||
assert casetype is not None
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_modlog_case_create(mod, ctx, member_factory):
|
||||
from datetime import datetime, timezone
|
||||
|
||||
@@ -33,7 +31,6 @@ async def test_modlog_case_create(mod, ctx, member_factory):
|
||||
assert case.created_at == int(created_at.timestamp())
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_modlog_set_modlog_channel(mod, ctx):
|
||||
await mod.set_modlog_channel(ctx.guild, ctx.channel)
|
||||
assert await mod.get_modlog_channel(ctx.guild) == ctx.channel.id
|
||||
|
||||
Reference in New Issue
Block a user