Ejemplo n.º 1
0
def test_create_pixel_from_pixel_bool_and_str(inp, expect):
    PXT1 = IMG.pixel_factory(
        value_type=bool,
        has_foreground=False,
        has_background=False,
        has_effects=False,
        translate_dots=False,
    )
    PXT2 = IMG.pixel_factory(
        value_type=str,
        has_foreground=False,
        has_background=False,
        has_effects=False,
        translate_dots=False,
    )
    px1 = PXT1(inp)
    px2 = PXT2(px1, context=Context(char="#"))
    assert px2.get_values(capabilities=PXT2.capabilities) == [expect]
Ejemplo n.º 2
0
def test_create_pixel_bool():
    PXT1 = IMG.pixel_factory(
        value_type=bool,
        has_foreground=False,
        has_background=False,
        has_effects=False,
        translate_dots=False,
    )
    px1 = PXT1(True)
    assert px1.get_values(capabilities=PXT1.capabilities) == [True]
Ejemplo n.º 3
0
def test_create_pixel_from_pixel_str_bool_pick_color_discard_effect():
    PXT1 = IMG.pixel_factory(
        value_type=str,
        has_foreground=False,
        has_background=False,
        has_effects=True,
        translate_dots=False,
    )
    PXT2 = IMG.pixel_factory(
        value_type=bool,
        has_foreground=True,
        has_background=False,
        has_effects=False,
        translate_dots=False,
    )
    px1 = PXT1("#", TM.Effects.underline)
    px2 = PXT2(px1, context=Context(color=(255, 0, 0)))
    assert px2.get_values(capabilities=PXT2.capabilities) == [
        True, (255, 0, 0)
    ]