Skip to content

Commit 98d06a2

Browse files
committed
Add λ test case
detailed log takes a weird mix of \x00 and \n as line separators hence the odd joining.
1 parent acb0f00 commit 98d06a2

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

jupyterlab_git/tests/test_detailed_log.py

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,35 @@
1515
async def test_detailed_log():
1616
with patch("jupyterlab_git.git.execute") as mock_execute:
1717
# Given
18-
process_output = [
18+
process_output_first_half = [
1919
"f29660a (HEAD, origin/feature) Commit message",
2020
"10\t3\tnotebook_without_spaces.ipynb",
2121
"11\t4\tNotebook with spaces.ipynb",
2222
"12\t5\tpath/notebook_without_spaces.ipynb",
2323
"13\t6\tpath/Notebook with spaces.ipynb",
24+
"14\t1\tpath/Notebook with λ.ipynb",
25+
]
26+
process_output_second_half = [
2427
" notebook_without_spaces.ipynb | 13 ++++++++---",
2528
" Notebook with spaces.ipynb | 15 +++++++++----",
2629
" path/notebook_without_spaces.ipynb | 17 ++++++++++-----",
2730
" 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(-)",
2933
]
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, "")
3239
)
3340

3441
expected_response = {
3542
"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",
4047
"modified_files": [
4148
{
4249
"modified_file_path": "notebook_without_spaces.ipynb",
@@ -62,6 +69,12 @@ async def test_detailed_log():
6269
"insertion": "13",
6370
"deletion": "6",
6471
},
72+
{
73+
"modified_file_path": "path/Notebook with λ.ipynb",
74+
"modified_file_name": "Notebook with λ.ipynb",
75+
"insertion": "14",
76+
"deletion": "1",
77+
},
6578
],
6679
}
6780

0 commit comments

Comments
 (0)