2018-11-03 23:40:20 +01:00
|
|
|
import pytest
|
2015-10-22 00:01:51 +02:00
|
|
|
|
2018-11-03 23:40:20 +01:00
|
|
|
from openslides.core.models import Projector
|
2015-10-22 00:01:51 +02:00
|
|
|
from openslides.utils import utils
|
|
|
|
|
|
|
|
|
2018-11-03 23:40:20 +01:00
|
|
|
def test_to_roman_result():
|
2019-01-06 16:22:33 +01:00
|
|
|
assert utils.to_roman(3) == "III"
|
2015-10-22 00:01:51 +02:00
|
|
|
|
2018-11-03 23:40:20 +01:00
|
|
|
|
|
|
|
def test_to_roman_none():
|
2019-01-06 16:22:33 +01:00
|
|
|
assert utils.to_roman(-3) == "-3"
|
2018-11-03 23:40:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_get_model_from_collection_string_known_app():
|
2019-01-06 16:22:33 +01:00
|
|
|
projector_model = utils.get_model_from_collection_string("core/projector")
|
2018-11-03 23:40:20 +01:00
|
|
|
assert projector_model == Projector
|
|
|
|
|
|
|
|
|
|
|
|
def test_get_model_from_collection_string_unknown_app():
|
|
|
|
with pytest.raises(ValueError):
|
2019-01-06 16:22:33 +01:00
|
|
|
utils.get_model_from_collection_string("invalid/model")
|