test_cmdhistory: Add test for __getitem__.
This commit is contained in:
parent
4a48ef2573
commit
3fac246744
@ -88,6 +88,14 @@ def test_getitem(hist):
|
|||||||
assert hist[i] == HISTORY[i]
|
assert hist[i] == HISTORY[i]
|
||||||
|
|
||||||
|
|
||||||
|
def test_setitem(hist):
|
||||||
|
"""Test __setitem__."""
|
||||||
|
with pytest.raises(TypeError) as excinfo:
|
||||||
|
hist[0] = 'foo'
|
||||||
|
expected = "'History' object does not support item assignment"
|
||||||
|
assert str(excinfo.value) == expected
|
||||||
|
|
||||||
|
|
||||||
def test_not_browsing_error(hist):
|
def test_not_browsing_error(hist):
|
||||||
"""Test that next/previtem throws a ValueError"""
|
"""Test that next/previtem throws a ValueError"""
|
||||||
with pytest.raises(ValueError) as error1:
|
with pytest.raises(ValueError) as error1:
|
||||||
@ -152,7 +160,6 @@ def test_append_private_mode(hist, config_stub):
|
|||||||
|
|
||||||
def test_append(hist, config_stub):
|
def test_append(hist, config_stub):
|
||||||
"""Test append outside private mode."""
|
"""Test append outside private mode."""
|
||||||
|
|
||||||
# Private mode is disabled (general.private-browsing is set to False)
|
# Private mode is disabled (general.private-browsing is set to False)
|
||||||
config_stub.data = CONFIG_NOT_PRIVATE
|
config_stub.data = CONFIG_NOT_PRIVATE
|
||||||
hist.append('new item')
|
hist.append('new item')
|
||||||
|
Loading…
Reference in New Issue
Block a user