Пример #1
0
def cell_size_test():
    b = Board(4, 9)
    _value = (34, 55)
    b.cell_size = _value
    assert b.cell_size[0] == _value[0]
    assert b.cell_size[1] == _value[1]
    b._setupUI()
    assert b.cell_size[0] == _value[0]
    assert b.cell_size[1] == _value[1]
    b.on_timer = lambda: b.close()
    b.start_timer(TIME_TO_CLOSE)
    b.show()
    assert b.cell_size[0] == _value[0]
    assert b.cell_size[1] == _value[1]

    b2 = Board(42, 99)
    _value = 1
    b2.cell_size = _value
    assert b2.cell_size[0] == _value
    assert b2.cell_size[1] == _value
    b2._setupUI()
    assert b2.cell_size[0] == _value
    assert b2.cell_size[1] == _value
    b2.on_timer = lambda: b.close()
    b2.start_timer(TIME_TO_CLOSE)
    b2.show()
    assert b2.cell_size[0] == _value
    assert b2.cell_size[1] == _value
Пример #2
0
    def test_cell_size(self):
        b = Board(4, 9)
        _value = (34, 55)
        b.cell_size = _value
        self.assertEqual(b.cell_size[0], _value[0])
        self.assertEqual(b.cell_size[1], _value[1])
        b._setupUI()
        self.assertEqual(b.cell_size[0], _value[0])
        self.assertEqual(b.cell_size[1], _value[1])
        b.on_timer = lambda: b.close()
        b.start_timer(TIME_TO_CLOSE)
        b.show()
        self.assertEqual(b.cell_size[0], _value[0])
        self.assertEqual(b.cell_size[1], _value[1])

        b2 = Board(42, 99)
        _value = 1
        b2.cell_size = _value
        self.assertEqual(b2.cell_size[0], _value)
        self.assertEqual(b2.cell_size[1], _value)
        b2._setupUI()
        self.assertEqual(b2.cell_size[0], _value)
        self.assertEqual(b2.cell_size[1], _value)
        b2.on_timer = lambda: b.close()
        b2.start_timer(TIME_TO_CLOSE)
        b2.show()
        self.assertEqual(b2.cell_size[0], _value)
        self.assertEqual(b2.cell_size[1], _value)
Пример #3
0
 def test_size(self):
     b = Board(3, 5)
     self.assertEqual(b.nrows, 3)
     self.assertEqual(b.ncols, 5)
     self.assertEqual(b.size, 15)
     b._setupUI()
     self.assertEqual(b.nrows, 3)
     self.assertEqual(b.ncols, 5)
     self.assertEqual(b.size, 15)
Пример #4
0
def size_test():
    b = Board(3, 5)
    assert b.nrows == 3
    assert b.ncols == 5
    assert b.size == 15
    b._setupUI()
    assert b.nrows == 3
    assert b.ncols == 5
    assert b.size == 15
Пример #5
0
def margin_color_test():
    b = Board(10, 10)
    _value = "dark gray"
    b.margin_color = _value
    assert b.margin_color == _value
    b._setupUI()
    assert b.margin_color == _value
    b.on_timer = lambda: b.close()
    b.start_timer(TIME_TO_CLOSE)
    b.show()
    assert b.margin_color == _value
Пример #6
0
def cell_spacing_test():
    b = Board(1, 1)
    _value = 7
    b.cell_spacing = _value
    assert b.cell_spacing == _value
    b._setupUI()
    assert b.cell_spacing == _value
    b.on_timer = lambda: b.close()
    b.start_timer(TIME_TO_CLOSE)
    b.show()
    assert b.cell_spacing == _value
Пример #7
0
def margin_test():
    b = Board(7, 1)
    _value = 19
    b.margin = _value
    assert b.margin == _value
    b._setupUI()
    assert b.margin == _value
    b.on_timer = lambda: b.close()
    b.start_timer(TIME_TO_CLOSE)
    b.show()
    assert b.margin == _value
Пример #8
0
def cursor_test():
    b = Board(1, 20)
    _value = "watch"
    b.cursor = _value
    assert b.cursor == _value
    b._setupUI()
    assert b.cursor == _value
    b.on_timer = lambda: b.close()
    b.start_timer(TIME_TO_CLOSE)
    b.show()
    assert b.cursor == _value
Пример #9
0
def grid_color_test():
    b = Board(4, 9)
    _value = "magenta"
    b.grid_color = _value
    assert b.grid_color == _value
    b._setupUI()
    assert b.grid_color == _value
    b.on_timer = lambda: b.close()
    b.start_timer(TIME_TO_CLOSE)
    b.show()
    assert b.grid_color == _value
Пример #10
0
 def test_grid_color(self):
     b = Board(4, 9)
     _value = "magenta"
     b.grid_color = _value
     self.assertEqual(b.grid_color, _value)
     b._setupUI()
     self.assertEqual(b.grid_color, _value)
     b.on_timer = lambda: b.close()
     b.start_timer(TIME_TO_CLOSE)
     b.show()
     self.assertEqual(b.grid_color, _value)
Пример #11
0
def cell_color_test():
    b = Board(4, 9)
    _value = "#000fff000"
    b.cell_color = _value
    assert b.cell_color == _value
    b._setupUI()
    assert b.cell_color == _value
    b.on_timer = lambda: b.close()
    b.start_timer(TIME_TO_CLOSE)
    b.show()
    assert b.cell_color == _value
Пример #12
0
 def test_margin_color(self):
     b = Board(10, 10)
     _value = "dark gray"
     b.margin_color = _value
     self.assertEqual(b.margin_color, _value)
     b._setupUI()
     self.assertEqual(b.margin_color, _value)
     b.on_timer = lambda: b.close()
     b.start_timer(TIME_TO_CLOSE)
     b.show()
     self.assertEqual(b.margin_color, _value)
Пример #13
0
 def test_cell_color(self):
     b = Board(4, 9)
     _value = "#000fff000"
     b.cell_color = _value
     self.assertEqual(b.cell_color, _value)
     b._setupUI()
     self.assertEqual(b.cell_color, _value)
     b.on_timer = lambda: b.close()
     b.start_timer(TIME_TO_CLOSE)
     b.show()
     self.assertEqual(b.cell_color, _value)
Пример #14
0
 def test_cell_spacing(self):
     b = Board(1, 1)
     _value = 7
     b.cell_spacing = _value
     self.assertEqual(b.cell_spacing, _value)
     b._setupUI()
     self.assertEqual(b.cell_spacing, _value)
     b.on_timer = lambda: b.close()
     b.start_timer(TIME_TO_CLOSE)
     b.show()
     self.assertEqual(b.cell_spacing, _value)
Пример #15
0
 def test_margin(self):
     b = Board(7, 1)
     _value = 19
     b.margin = _value
     self.assertEqual(b.margin, _value)
     b._setupUI()
     self.assertEqual(b.margin, _value)
     b.on_timer = lambda: b.close()
     b.start_timer(TIME_TO_CLOSE)
     b.show()
     self.assertEqual(b.margin, _value)
Пример #16
0
 def test_cursor(self):
     b = Board(1, 20)
     _value = "watch"
     b.cursor = _value
     self.assertEqual(b.cursor, _value)
     b._setupUI()
     self.assertEqual(b.cursor, _value)
     b.on_timer = lambda: b.close()
     b.start_timer(TIME_TO_CLOSE)
     b.show()
     self.assertEqual(b.cursor, _value)
Пример #17
0
def title_test():
    b = Board(2, 2)
    _value = "qwertyu 213213  dsdadasd~...."
    b.title = _value
    assert b.title == _value
    b._setupUI()
    assert b.title == _value
    assert b._root.title() == _value
    b.on_timer = lambda: b.close()
    b.start_timer(TIME_TO_CLOSE)
    b.show()
    assert b.title == _value
    assert b._root.title() == _value
Пример #18
0
 def test_title(self):
     b = Board(2, 2)
     _value = "qwertyu 213213  dsdadasd~...."
     b.title = _value
     self.assertEqual(b.title, _value)
     b._setupUI()
     self.assertEqual(b.title, _value)
     self.assertEqual(b._root.title(), _value)
     b.on_timer = lambda: b.close()
     b.start_timer(TIME_TO_CLOSE)
     b.show()
     self.assertEqual(b.title, _value)
     self.assertEqual(b._root.title(), _value)