File: TestUtil.py

package info (click to toggle)
uranium 5.0.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,304 kB
  • sloc: python: 31,765; sh: 132; makefile: 12
file content (17 lines) | stat: -rw-r--r-- 457 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from unittest.mock import MagicMock

from UM.Util import parseBool
import pytest

positive_results = [True, "True", "true", "Yes", "yes", 1]
negative_results = [False, "False", "false", "No", "no", 0, None, "I like turtles", MagicMock()]


@pytest.mark.parametrize("value", positive_results)
def test_positive(value):
    assert parseBool(value)


@pytest.mark.parametrize("value", negative_results)
def test_negative(value):
    assert not parseBool(value)