예제 #1
0
def test_illegal_create__oob_3(GRID, LOGGER):
    test_grid = GRID(5, 7, 90, 210)
    try:
        _ = widgets.Widget('11', 'Test E', test_grid, 0, 6, 1, 2, 1, 0, LOGGER)
        assert False
    except err.PyCUIOutOfBoundsError:
        assert True
예제 #2
0
def test_illegal_create_4():
    try:
        _ = widgets.Widget('11', 'Test E',
                           test_grid, 0, 6, 1, 2, 1, 0, logger)
        assert False
    except err.PyCUIOutOfBoundsError:
        assert True
예제 #3
0
def test_illegal_create_3():
    try:
        test_cell_E = widgets.Widget('10', 'Test E', test_grid, 4, 0, 3, 1, 1,
                                     0)
        assert False
    except err.PyCUIOutOfBoundsError:
        assert True
예제 #4
0
def test_illegal_create_no_parent_grid(LOGGER):
    try:
        _ = widgets.Widget('8', 'Test E', None, 0, 5, 1, 1, 1, 0, LOGGER)
        assert False
    except err.PyCUIMissingParentError:
        assert True
예제 #5
0
def test_illegal_create_1():
    try:
        _ = widgets.Widget('8', 'Test E', None, 0, 5, 1, 1, 1, 0, logger)
        assert False
    except err.PyCUIMissingParentError:
        assert True
예제 #6
0
import pytest # noqa

import py_cui.grid as grid
import py_cui.widgets as widgets
import py_cui.errors as err

import py_cui.debug as dbg

logger = dbg.PyCUILogger('PYCUI TEST')


test_grid = grid.Grid(5, 7, 90, 210, logger)

test_cell_A = widgets.Widget('1', 'TestA',
                             test_grid, 0, 0, 1, 1, 1, 0, logger)

test_cell_B = widgets.Widget('2', 'Test B',
                             test_grid, 3, 4, 2, 1, 1, 0, logger)

test_cell_C = widgets.Widget('3', 'Test C',
                             test_grid, 1, 2, 1, 3, 1, 0, logger)

test_cell_D = widgets.Widget('4',
                             'Test D -----------------------------------',
                             test_grid, 0, 0, 1, 1, 1, 0, logger)


# grid spot width should be 6 x 6, with an overlap of 2 chars on the edges
test_grid_over = grid.Grid(3, 3, 20, 20, logger)
test_cell_over_A = widgets.Widget('5', 'Test Over A',
                                  test_grid_over, 2, 0, 1, 1, 1, 0, logger)