示例#1
0
 def test_main_app_with_default_sorting(self, mock_write, mock_read):
     mock_read.return_value = ["ab", "za", "ba", "aa"]
     main_app("input", "output")
     mock_write.assert_called_once_with("output", ["za", "ba", "ab", "aa"])
示例#2
0
 def test_main_app_for_words_with_extra_spaces(self, mock_write, mock_read):
     mock_read.return_value = [" abc ", "bz  ", "   ca"]
     main_app("input", "output")
     mock_write.assert_called_once_with("output", ["ca", "bz", "abc"])
示例#3
0
 def test_main_app_with_number(self, mock_write, mock_read):
     mock_read.return_value = ["2", "66", "9"]
     main_app("input", "output")
     mock_write.assert_called_once_with("output", [])
示例#4
0
 def test_main_app_with_letter_and_number_mix(self, mock_write, mock_read):
     mock_read.return_value = ["ab2", "b2c", "1aa"]
     main_app("input", "output")
     mock_write.assert_called_once_with("output", [])
示例#5
0
 def test_main_app_with_none_ascii_character(self, mock_write, mock_read):
     mock_read.return_value = ["!", "*", "%"]
     main_app("input", "output")
     mock_write.assert_called_once_with("output", [])