|
7 | 7 |
|
8 | 8 |
|
9 | 9 | def test_generate_name_from_command(): |
10 | | - date_lenght = 20 |
| 10 | + date_length = 20 |
11 | 11 |
|
12 | 12 | command = "command arg1 arg2" |
13 | 13 | expected = "_".join(command.split()) |
14 | | - assert_equal(smartdispatch.generate_name_from_command(command)[date_lenght:], expected) |
| 14 | + assert_equal(smartdispatch.generate_name_from_command(command)[date_length:], expected) |
15 | 15 |
|
16 | 16 | max_length_arg = 7 |
17 | 17 | long_arg = "veryverylongarg1" |
18 | 18 | command = "command " + long_arg + " arg2" |
19 | 19 | expected = command.split() |
20 | 20 | expected[1] = long_arg[-max_length_arg:] |
21 | 21 | expected = "_".join(expected) |
22 | | - assert_equal(smartdispatch.generate_name_from_command(command, max_length_arg)[date_lenght:], expected) |
| 22 | + assert_equal(smartdispatch.generate_name_from_command(command, max_length_arg)[date_length:], expected) |
23 | 23 |
|
24 | 24 | max_length = 23 |
25 | 25 | command = "command veryverylongarg1 veryverylongarg1 veryverylongarg1 veryverylongarg1" |
26 | 26 | expected = command[:max_length].replace(" ", "_") |
27 | | - assert_equal(smartdispatch.generate_name_from_command(command, max_length=max_length + date_lenght)[date_lenght:], expected) |
| 27 | + assert_equal(smartdispatch.generate_name_from_command(command, max_length=max_length + date_length)[date_length:], expected) |
28 | 28 |
|
29 | 29 | # Test path arguments in command |
30 | 30 | command = "command path/number/one path/number/two" |
31 | 31 | expected = "command_pathnumberone_pathnumbertwo" |
32 | | - assert_equal(smartdispatch.generate_name_from_command(command)[date_lenght:], expected) |
| 32 | + assert_equal(smartdispatch.generate_name_from_command(command)[date_length:], expected) |
33 | 33 |
|
34 | 34 |
|
35 | 35 | def test_get_commands_from_file(): |
|
0 commit comments