Skip to content

Commit

Permalink
fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xantric committed Dec 20, 2023
1 parent 5cb5fcc commit 6daeb31
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions fury/ui/tests/test_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,56 +255,57 @@ def test_ui_tab_ui_top(interactive=False):
expected_events_counts_filename = pjoin(DATA_DIR, filename + '.json')

tab_ui = ui.TabUI(
position=(50, 50), size=(300, 300), nb_tabs=3, draggable=True, tabBar_pos="top")
position=(50, 50), size=(300, 300), nb_tabs=3, draggable=True,
tabBar_pos="top")

tab_ui.tabs[0].title = 'Tab 1'
tab_ui.tabs[1].title = 'Tab 2'
tab_ui.tabs[2].title = 'Tab 3'

npt.assert_equal(tab_ui.tabs[0].title_bold, False)
npt.assert_equal(tab_ui.tabs[1].title_bold, False)
npt.assert_equal(tab_ui.tabs[2].title_bold, False)

tab_ui.tabs[0].title_bold = True
tab_ui.tabs[1].title_bold = False
tab_ui.tabs[2].title_bold = True

npt.assert_equal(tab_ui.tabs[0].title_bold, True)
npt.assert_equal(tab_ui.tabs[1].title_bold, False)
npt.assert_equal(tab_ui.tabs[2].title_bold, True)

npt.assert_equal(tab_ui.tabs[0].title_color, (.0, .0, .0))
npt.assert_equal(tab_ui.tabs[1].title_color, (.0, .0, .0))
npt.assert_equal(tab_ui.tabs[2].title_color, (.0, .0, .0))

tab_ui.tabs[0].title_color = (1, 0, 0)
tab_ui.tabs[1].title_color = (0, 1, 0)
tab_ui.tabs[2].title_color = (0, 0, 1)

npt.assert_equal(tab_ui.tabs[0].title_color, (1., .0, .0))
npt.assert_equal(tab_ui.tabs[1].title_color, (.0, 1., .0))
npt.assert_equal(tab_ui.tabs[2].title_color, (.0, .0, 1.))

npt.assert_equal(tab_ui.tabs[0].title_font_size, 18)
npt.assert_equal(tab_ui.tabs[1].title_font_size, 18)
npt.assert_equal(tab_ui.tabs[2].title_font_size, 18)

tab_ui.tabs[0].title_font_size = 10
tab_ui.tabs[1].title_font_size = 20
tab_ui.tabs[2].title_font_size = 30

npt.assert_equal(tab_ui.tabs[0].title_font_size, 10)
npt.assert_equal(tab_ui.tabs[1].title_font_size, 20)
npt.assert_equal(tab_ui.tabs[2].title_font_size, 30)

npt.assert_equal(tab_ui.tabs[0].title_italic, False)
npt.assert_equal(tab_ui.tabs[1].title_italic, False)
npt.assert_equal(tab_ui.tabs[2].title_italic, False)

tab_ui.tabs[0].title_italic = False
tab_ui.tabs[1].title_italic = True
tab_ui.tabs[2].title_italic = False

npt.assert_equal(tab_ui.tabs[0].title_italic, False)
npt.assert_equal(tab_ui.tabs[1].title_italic, True)
npt.assert_equal(tab_ui.tabs[2].title_italic, False)
Expand Down Expand Up @@ -361,62 +362,64 @@ def tab_change(tab_ui):
npt.assert_equal(11, next(changes))
npt.assert_equal(5, next(collapses))


def test_ui_tab_ui_bottom(interactive=False):
filename = 'test_ui_tab_ui_bottom'
recording_filename = pjoin(DATA_DIR, filename + '.log.gz')
expected_events_counts_filename = pjoin(DATA_DIR, filename + '.json')

tab_ui = ui.TabUI(
position=(50, 50), size=(300, 300), nb_tabs=3, draggable=True, tabBar_pos="bottom")
position=(50, 50), size=(300, 300), nb_tabs=3, draggable=True,
tabBar_pos="bottom")

tab_ui.tabs[0].title = 'Tab 1'
tab_ui.tabs[1].title = 'Tab 2'
tab_ui.tabs[2].title = 'Tab 3'

npt.assert_equal(tab_ui.tabs[0].title_bold, False)
npt.assert_equal(tab_ui.tabs[1].title_bold, False)
npt.assert_equal(tab_ui.tabs[2].title_bold, False)

tab_ui.tabs[0].title_bold = True
tab_ui.tabs[1].title_bold = False
tab_ui.tabs[2].title_bold = True

npt.assert_equal(tab_ui.tabs[0].title_bold, True)
npt.assert_equal(tab_ui.tabs[1].title_bold, False)
npt.assert_equal(tab_ui.tabs[2].title_bold, True)

npt.assert_equal(tab_ui.tabs[0].title_color, (.0, .0, .0))
npt.assert_equal(tab_ui.tabs[1].title_color, (.0, .0, .0))
npt.assert_equal(tab_ui.tabs[2].title_color, (.0, .0, .0))

tab_ui.tabs[0].title_color = (1, 0, 0)
tab_ui.tabs[1].title_color = (0, 1, 0)
tab_ui.tabs[2].title_color = (0, 0, 1)

npt.assert_equal(tab_ui.tabs[0].title_color, (1., .0, .0))
npt.assert_equal(tab_ui.tabs[1].title_color, (.0, 1., .0))
npt.assert_equal(tab_ui.tabs[2].title_color, (.0, .0, 1.))

npt.assert_equal(tab_ui.tabs[0].title_font_size, 18)
npt.assert_equal(tab_ui.tabs[1].title_font_size, 18)
npt.assert_equal(tab_ui.tabs[2].title_font_size, 18)

tab_ui.tabs[0].title_font_size = 10
tab_ui.tabs[1].title_font_size = 20
tab_ui.tabs[2].title_font_size = 30

npt.assert_equal(tab_ui.tabs[0].title_font_size, 10)
npt.assert_equal(tab_ui.tabs[1].title_font_size, 20)
npt.assert_equal(tab_ui.tabs[2].title_font_size, 30)

npt.assert_equal(tab_ui.tabs[0].title_italic, False)
npt.assert_equal(tab_ui.tabs[1].title_italic, False)
npt.assert_equal(tab_ui.tabs[2].title_italic, False)

tab_ui.tabs[0].title_italic = False
tab_ui.tabs[1].title_italic = True
tab_ui.tabs[2].title_italic = False

npt.assert_equal(tab_ui.tabs[0].title_italic, False)
npt.assert_equal(tab_ui.tabs[1].title_italic, True)
npt.assert_equal(tab_ui.tabs[2].title_italic, False)
Expand Down Expand Up @@ -471,4 +474,4 @@ def tab_change(tab_ui):

npt.assert_equal(0, tab_ui.active_tab_idx)
npt.assert_equal(11, next(changes))
npt.assert_equal(4, next(collapses))
npt.assert_equal(4, next(collapses))

0 comments on commit 6daeb31

Please sign in to comment.