Correct line endings
This commit is contained in:
parent
5e701e30aa
commit
1d7bf6969a
3320
plugin/__init__.py
3320
plugin/__init__.py
File diff suppressed because it is too large
Load Diff
@ -1,74 +1,74 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from conftest import ac
|
from conftest import ac
|
||||||
|
|
||||||
|
|
||||||
def test_deckNames(session_with_profile_loaded):
|
def test_deckNames(session_with_profile_loaded):
|
||||||
result = ac.deckNames()
|
result = ac.deckNames()
|
||||||
assert result == ["Default"]
|
assert result == ["Default"]
|
||||||
|
|
||||||
|
|
||||||
def test_deckNamesAndIds(session_with_profile_loaded):
|
def test_deckNamesAndIds(session_with_profile_loaded):
|
||||||
result = ac.deckNamesAndIds()
|
result = ac.deckNamesAndIds()
|
||||||
assert result == {"Default": 1}
|
assert result == {"Default": 1}
|
||||||
|
|
||||||
|
|
||||||
def test_createDeck(session_with_profile_loaded):
|
def test_createDeck(session_with_profile_loaded):
|
||||||
ac.createDeck("foo")
|
ac.createDeck("foo")
|
||||||
assert {*ac.deckNames()} == {"Default", "foo"}
|
assert {*ac.deckNames()} == {"Default", "foo"}
|
||||||
|
|
||||||
|
|
||||||
def test_changeDeck(setup):
|
def test_changeDeck(setup):
|
||||||
ac.changeDeck(cards=setup.card_ids, deck="bar")
|
ac.changeDeck(cards=setup.card_ids, deck="bar")
|
||||||
assert "bar" in ac.deckNames()
|
assert "bar" in ac.deckNames()
|
||||||
|
|
||||||
|
|
||||||
def test_deleteDeck(setup):
|
def test_deleteDeck(setup):
|
||||||
before = ac.deckNames()
|
before = ac.deckNames()
|
||||||
ac.deleteDecks(decks=["test_deck"], cardsToo=True)
|
ac.deleteDecks(decks=["test_deck"], cardsToo=True)
|
||||||
after = ac.deckNames()
|
after = ac.deckNames()
|
||||||
assert {*before} - {*after} == {"test_deck"}
|
assert {*before} - {*after} == {"test_deck"}
|
||||||
|
|
||||||
|
|
||||||
def test_deleteDeck_must_be_called_with_cardsToo_set_to_True_on_later_api(setup):
|
def test_deleteDeck_must_be_called_with_cardsToo_set_to_True_on_later_api(setup):
|
||||||
with pytest.raises(Exception):
|
with pytest.raises(Exception):
|
||||||
ac.deleteDecks(decks=["test_deck"])
|
ac.deleteDecks(decks=["test_deck"])
|
||||||
with pytest.raises(Exception):
|
with pytest.raises(Exception):
|
||||||
ac.deleteDecks(decks=["test_deck"], cardsToo=False)
|
ac.deleteDecks(decks=["test_deck"], cardsToo=False)
|
||||||
|
|
||||||
|
|
||||||
def test_getDeckConfig(session_with_profile_loaded):
|
def test_getDeckConfig(session_with_profile_loaded):
|
||||||
result = ac.getDeckConfig(deck="Default")
|
result = ac.getDeckConfig(deck="Default")
|
||||||
assert result["name"] == "Default"
|
assert result["name"] == "Default"
|
||||||
|
|
||||||
|
|
||||||
def test_saveDeckConfig(session_with_profile_loaded):
|
def test_saveDeckConfig(session_with_profile_loaded):
|
||||||
config = ac.getDeckConfig(deck="Default")
|
config = ac.getDeckConfig(deck="Default")
|
||||||
result = ac.saveDeckConfig(config=config)
|
result = ac.saveDeckConfig(config=config)
|
||||||
assert result is True
|
assert result is True
|
||||||
|
|
||||||
|
|
||||||
def test_setDeckConfigId(session_with_profile_loaded):
|
def test_setDeckConfigId(session_with_profile_loaded):
|
||||||
result = ac.setDeckConfigId(decks=["Default"], configId=1)
|
result = ac.setDeckConfigId(decks=["Default"], configId=1)
|
||||||
assert result is True
|
assert result is True
|
||||||
|
|
||||||
|
|
||||||
def test_cloneDeckConfigId(session_with_profile_loaded):
|
def test_cloneDeckConfigId(session_with_profile_loaded):
|
||||||
result = ac.cloneDeckConfigId(cloneFrom=1, name="test")
|
result = ac.cloneDeckConfigId(cloneFrom=1, name="test")
|
||||||
assert isinstance(result, int)
|
assert isinstance(result, int)
|
||||||
|
|
||||||
|
|
||||||
def test_removedDeckConfigId(session_with_profile_loaded):
|
def test_removedDeckConfigId(session_with_profile_loaded):
|
||||||
new_config_id = ac.cloneDeckConfigId(cloneFrom=1, name="test")
|
new_config_id = ac.cloneDeckConfigId(cloneFrom=1, name="test")
|
||||||
assert ac.removeDeckConfigId(configId=new_config_id) is True
|
assert ac.removeDeckConfigId(configId=new_config_id) is True
|
||||||
|
|
||||||
|
|
||||||
def test_removedDeckConfigId_fails_with_invalid_id(session_with_profile_loaded):
|
def test_removedDeckConfigId_fails_with_invalid_id(session_with_profile_loaded):
|
||||||
new_config_id = ac.cloneDeckConfigId(cloneFrom=1, name="test")
|
new_config_id = ac.cloneDeckConfigId(cloneFrom=1, name="test")
|
||||||
assert ac.removeDeckConfigId(configId=new_config_id) is True
|
assert ac.removeDeckConfigId(configId=new_config_id) is True
|
||||||
assert ac.removeDeckConfigId(configId=new_config_id) is False
|
assert ac.removeDeckConfigId(configId=new_config_id) is False
|
||||||
|
|
||||||
|
|
||||||
def test_getDeckStats(session_with_profile_loaded):
|
def test_getDeckStats(session_with_profile_loaded):
|
||||||
result = ac.getDeckStats(decks=["Default"])
|
result = ac.getDeckStats(decks=["Default"])
|
||||||
assert list(result.values())[0]["name"] == "Default"
|
assert list(result.values())[0]["name"] == "Default"
|
||||||
|
Loading…
Reference in New Issue
Block a user