Parametrization for completion tests
This commit is contained in:
parent
8be433f5f6
commit
61a6b196e9
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
"""Tests for qutebrowser.completion.models column widths"""
|
"""Tests for qutebrowser.completion.models column widths"""
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from qutebrowser.completion.models.base import BaseCompletionModel
|
from qutebrowser.completion.models.base import BaseCompletionModel
|
||||||
from qutebrowser.completion.models.configmodel import (
|
from qutebrowser.completion.models.configmodel import (
|
||||||
SettingOptionCompletionModel, SettingSectionCompletionModel,
|
SettingOptionCompletionModel, SettingSectionCompletionModel,
|
||||||
@ -40,12 +42,16 @@ class TestColumnWidths:
|
|||||||
BookmarkCompletionModel, SessionCompletionModel,
|
BookmarkCompletionModel, SessionCompletionModel,
|
||||||
UrlCompletionModel]
|
UrlCompletionModel]
|
||||||
|
|
||||||
def test_list_size(self):
|
@pytest.mark.parametrize("model", CLASSES)
|
||||||
"""Test if there are 3 items in the COLUMN_WIDTHS property"""
|
def test_list_size(self, model):
|
||||||
for model in self.CLASSES:
|
|
||||||
assert model.COLUMN_WIDTHS.__len__() == 3
|
"""Test if there are 3 items in the COLUMN_WIDTHS property"""
|
||||||
|
|
||||||
|
assert len(model.COLUMN_WIDTHS) == 3
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("model", CLASSES)
|
||||||
|
def test_column_width_sum(self, model):
|
||||||
|
|
||||||
def test_column_width_sum(self):
|
|
||||||
"""Test if the sum of the widths asserts to 100"""
|
"""Test if the sum of the widths asserts to 100"""
|
||||||
for model in self.CLASSES:
|
|
||||||
assert sum(model.COLUMN_WIDTHS) == 100
|
assert sum(model.COLUMN_WIDTHS) == 100
|
||||||
|
Loading…
Reference in New Issue
Block a user