Merge branch 'test-sorting-num-prefix' into 'master'

Add a naturel sorting test

See merge request openlp/openlp!545
This commit is contained in:
Raoul Snyman 2023-01-11 21:26:50 +00:00
commit 2b5fd98bac
2 changed files with 11 additions and 1 deletions

View File

@ -141,6 +141,16 @@ def test_get_natural_key():
# THEN: We get a properly sorted list
assert sorted_list == ['1st item', 'item 3b', 'item 10a'], 'Numbers should be sorted naturally'
# GIVEN: The language is still English (a language, which sorts digits before letters)
mocked_get_language.return_value = 'en'
unsorted_list = ['1 songname', '100 songname', '2 songname']
# WHEN: We sort the list and use get_natural_key() to generate the sorting keys
sorted_list = sorted(unsorted_list, key=get_natural_key)
# THEN: We get a properly sorted list
assert sorted_list == ['1 songname', '2 songname', '100 songname'], 'Numbers should be sorted naturally'
def test_check_same_instance():
"""

View File

@ -462,7 +462,7 @@ def test_fix_font_bold_not_windows(mocked_is_win, display_window_env, mock_setti
@patch('openlp.core.display.window.is_win')
def test_fix_font_foundry(mocked_is_win, display_window_env, mock_settings):
def test_fix_font_foundry(mocked_is_win, display_window_env, mock_settings, registry):
"""
Test that a font with a foundry name in it has the foundry removed
"""