15
15
async def test_detailed_log ():
16
16
with patch ("jupyterlab_git.git.execute" ) as mock_execute :
17
17
# Given
18
- process_output = [
18
+ process_output_first_half = [
19
19
"f29660a (HEAD, origin/feature) Commit message" ,
20
20
"10\t 3\t notebook_without_spaces.ipynb" ,
21
21
"11\t 4\t Notebook with spaces.ipynb" ,
22
22
"12\t 5\t path/notebook_without_spaces.ipynb" ,
23
23
"13\t 6\t path/Notebook with spaces.ipynb" ,
24
+ "14\t 1\t path/Notebook with λ.ipynb" ,
25
+ ]
26
+ process_output_second_half = [
24
27
" notebook_without_spaces.ipynb | 13 ++++++++---" ,
25
28
" Notebook with spaces.ipynb | 15 +++++++++----" ,
26
29
" path/notebook_without_spaces.ipynb | 17 ++++++++++-----" ,
27
30
" path/Notebook with spaces.ipynb | 19 +++++++++++------" ,
28
- " 4 files changed, 46 insertions(+), 18 deletions(-)" ,
31
+ " path/Notebook with λ.ipynb | 15 +++++++++++-" ,
32
+ " 5 files changed, 50 insertions(+), 19 deletions(-)" ,
29
33
]
30
- mock_execute .return_value = tornado .gen .maybe_future (
31
- (0 , "\x00 " .join (process_output ), "" )
34
+ process_output_first_half = "\x00 " .join (process_output_first_half )
35
+ process_output_second_half = "\n " .join (process_output_second_half )
36
+ process_output = process_output_first_half + "\x00 " + process_output_second_half
37
+ mock_execute ._mock_return_value = tornado .gen .maybe_future (
38
+ (0 , process_output , "" )
32
39
)
33
40
34
41
expected_response = {
35
42
"code" : 0 ,
36
- "modified_file_note" : " 4 files changed, 46 insertions(+), 18 deletions(-)" ,
37
- "modified_files_count" : "4 " ,
38
- "number_of_insertions" : "46 " ,
39
- "number_of_deletions" : "18 " ,
43
+ "modified_file_note" : " 5 files changed, 50 insertions(+), 19 deletions(-)" ,
44
+ "modified_files_count" : "5 " ,
45
+ "number_of_insertions" : "50 " ,
46
+ "number_of_deletions" : "19 " ,
40
47
"modified_files" : [
41
48
{
42
49
"modified_file_path" : "notebook_without_spaces.ipynb" ,
@@ -62,6 +69,12 @@ async def test_detailed_log():
62
69
"insertion" : "13" ,
63
70
"deletion" : "6" ,
64
71
},
72
+ {
73
+ "modified_file_path" : "path/Notebook with λ.ipynb" ,
74
+ "modified_file_name" : "Notebook with λ.ipynb" ,
75
+ "insertion" : "14" ,
76
+ "deletion" : "1" ,
77
+ },
65
78
],
66
79
}
67
80
0 commit comments