Parametrization for completion tests

This commit is contained in:
Alexander Cogneau 2015-08-12 09:08:04 +02:00
parent 8be433f5f6
commit 61a6b196e9

View File

@ -19,6 +19,8 @@
"""Tests for qutebrowser.completion.models column widths"""
import pytest
from qutebrowser.completion.models.base import BaseCompletionModel
from qutebrowser.completion.models.configmodel import (
SettingOptionCompletionModel, SettingSectionCompletionModel,
@ -40,12 +42,16 @@ class TestColumnWidths:
BookmarkCompletionModel, SessionCompletionModel,
UrlCompletionModel]
def test_list_size(self):
"""Test if there are 3 items in the COLUMN_WIDTHS property"""
for model in self.CLASSES:
assert model.COLUMN_WIDTHS.__len__() == 3
@pytest.mark.parametrize("model", CLASSES)
def test_list_size(self, model):
"""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"""
for model in self.CLASSES:
assert sum(model.COLUMN_WIDTHS) == 100