示例#1
0
 def test_fixed_width_file_name_with_none_filename_return_empty_string(
         self):
     test = cli.fixed_width_file_name(None, 25)
     expected = ''
     assert expected == test
示例#2
0
 def test_fixed_width_file_name_with_file_name_at_max_length_is_not_shortened(
         self):
     test = cli.fixed_width_file_name('01234567890123456789012.c', 25)
     expected = '01234567890123456789012.c'
     assert expected == test
示例#3
0
 def test_fixed_width_file_name_with_file_name_smaller_than_max_length_not_shortened(
         self):
     test = cli.fixed_width_file_name('0123456789012345678901.c', 25)
     expected = '0123456789012345678901.c'
     assert expected == test
示例#4
0
 def test_fixed_width_file_name_with_file_name_smaller_than_max_length_is_not_shortened(self):
     file_name = '0123456789012345678901234.c'
     test = cli.fixed_width_file_name(file_name, max_length=50)
     assert file_name == test
示例#5
0
 def test_fixed_width_file_name_with_file_name_smaller_than_max_length_is_not_shortened(
         self):
     file_name = '0123456789012345678901234.c'
     test = cli.fixed_width_file_name(file_name, max_length=50)
     assert file_name == test
示例#6
0
 def test_fixed_width_file_name_with_posix_path_with_shortening(self):
     test = cli.fixed_width_file_name(
         'C/Documents_and_Settings/Boki/Desktop/head/patches/drupal6/012345678901234567890123.c',
         25)
     expected = '0123456789...4567890123.c'
     assert expected == test
示例#7
0
 def test_fixed_width_file_name_with_win_path_with_shortening(self):
     test = cli.fixed_width_file_name(
         'C\\:Documents_and_Settings\\Boki\\Desktop\\head\\patches\\drupal6\\012345678901234567890123.c',
         25)
     expected = '0123456789...4567890123.c'
     assert expected == test
示例#8
0
 def test_fixed_width_file_name_with_posix_path_with_shortening(self):
     test = cli.fixed_width_file_name('C/Documents_and_Settings/Boki/Desktop/head/patches/drupal6/012345678901234567890123.c', 25)
     expected = '0123456789...4567890123.c'
     assert expected == test
示例#9
0
 def test_fixed_width_file_name_with_win_path_without_shortening(self):
     test = cli.fixed_width_file_name('C\\:Documents_and_Settings\\Boki\\Desktop\\head\\patches\\drupal6\\drupal.js', 25)
     expected = 'drupal.js'
     assert expected == test
示例#10
0
 def test_fixed_width_file_name_without_extension(self):
     test = cli.fixed_width_file_name('012345678901234567890123456', 25)
     expected = '01234567890...67890123456'
     assert expected == test
示例#11
0
 def test_fixed_width_file_name_with_posix_path_without_shortening(self):
     test = cli.fixed_width_file_name('C/Documents_and_Settings/Boki/Desktop/head/patches/drupal6/drupal.js', 25)
     expected = 'drupal.js'
     assert expected == test
示例#12
0
 def test_fixed_width_file_name_with_none_filename_return_empty_string(self):
     test = cli.fixed_width_file_name(None, 25)
     expected = ''
     assert expected == test
示例#13
0
 def test_fixed_width_file_name_with_file_name_smaller_than_max_length_not_shortened(self):
     test = cli.fixed_width_file_name('0123456789012345678901.c', 25)
     expected = '0123456789012345678901.c'
     assert expected == test
示例#14
0
 def test_fixed_width_file_name_with_file_name_at_max_length_is_not_shortened(self):
     test = cli.fixed_width_file_name('01234567890123456789012.c', 25)
     expected = '01234567890123456789012.c'
     assert expected == test
示例#15
0
 def test_fixed_width_file_name_without_extension(self):
     test = cli.fixed_width_file_name('012345678901234567890123456', 25)
     expected = '01234567890...67890123456'
     assert expected == test
示例#16
0
 def test_fixed_width_file_name_with_win_path_with_shortening(self):
     test = cli.fixed_width_file_name('C\\:Documents_and_Settings\\Boki\\Desktop\\head\\patches\\drupal6\\012345678901234567890123.c', 25)
     expected = '0123456789...4567890123.c'
     assert expected == test
示例#17
0
 def test_fixed_width_file_name_with_posix_path_without_shortening(self):
     test = cli.fixed_width_file_name(
         'C/Documents_and_Settings/Boki/Desktop/head/patches/drupal6/drupal.js',
         25)
     expected = 'drupal.js'
     assert expected == test
示例#18
0
 def test_fixed_width_file_name_with_very_small_file_name_and_long_extension(self):
     test = cli.fixed_width_file_name('abc.abcdef', 5)
     # FIXME: what is expected is TBD
     expected = ''
     assert expected == test
示例#19
0
 def test_fixed_width_file_name_with_win_path_without_shortening(self):
     test = cli.fixed_width_file_name(
         'C\\:Documents_and_Settings\\Boki\\Desktop\\head\\patches\\drupal6\\drupal.js',
         25)
     expected = 'drupal.js'
     assert expected == test
示例#20
0
 def test_fixed_width_file_name_with_file_name_larger_than_max_length_is_shortened(
         self):
     test = cli.fixed_width_file_name('0123456789012345678901234.c', 25)
     expected = '0123456789...5678901234.c'
     assert expected == test
示例#21
0
 def test_fixed_width_file_name_with_very_small_file_name_and_long_extension(
         self):
     test = cli.fixed_width_file_name('abc.abcdef', 5)
     # FIXME: what is expected is TBD
     expected = ''
     assert expected == test
示例#22
0
 def test_fixed_width_file_name_with_file_name_larger_than_max_length_is_shortened(self):
     test = cli.fixed_width_file_name('0123456789012345678901234.c', 25)
     expected = '0123456789...5678901234.c'
     assert expected == test