"""Unit tests for slot helper functions."""
from __future__ import annotations

import pytest

from events.bp.calendar.services.slots import _b


class TestBoolParse:
    def test_true_bool(self):
        assert _b(True) is True

    def test_false_bool(self):
        assert _b(False) is False

    def test_string_true(self):
        assert _b("true") is True

    def test_string_True(self):
        assert _b("True") is True

    def test_string_1(self):
        assert _b("1") is True

    def test_string_yes(self):
        assert _b("yes") is True

    def test_string_y(self):
        assert _b("y") is True

    def test_string_t(self):
        assert _b("t") is True

    def test_string_on(self):
        assert _b("on") is True

    def test_string_false(self):
        assert _b("false") is False

    def test_string_0(self):
        assert _b("0") is False

    def test_string_no(self):
        assert _b("no") is False

    def test_string_off(self):
        assert _b("off") is False

    def test_string_empty(self):
        assert _b("") is False

    def test_int_1(self):
        assert _b(1) is True

    def test_int_0(self):
        assert _b(0) is False

    def test_random_string(self):
        assert _b("maybe") is False
