Skip to content
  • Sponsor
  • Notifications You must be signed in to change notification settings
  • Fork 50

Commit c02d0ea

Browse files
committedApr 27, 2019
Tweaked output formatting for better consistency
1 parent b2523fc commit c02d0ea

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed
 

‎csv_diff/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def human_text(result, key=None, singular=None, plural=None):
7575
)
7676
title.append(fragment)
7777
summary.extend(
78-
[fragment]
79-
+ [" {}".format(c) for c in sorted(result["columns_added"])]
78+
[fragment, ""]
79+
+ [" {}".format(c) for c in sorted(result["columns_added"])]
8080
+ [""]
8181
)
8282
if result["columns_removed"]:
@@ -86,8 +86,8 @@ def human_text(result, key=None, singular=None, plural=None):
8686
)
8787
title.append(fragment)
8888
summary.extend(
89-
[fragment]
90-
+ [" {}".format(c) for c in sorted(result["columns_removed"])]
89+
[fragment, ""]
90+
+ [" {}".format(c) for c in sorted(result["columns_removed"])]
9191
+ [""]
9292
)
9393
if result["changed"]:

‎tests/test_human_text.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ def test_columns_changed():
125125
1 column added, 1 column removed
126126
127127
1 column added
128-
weight
128+
129+
weight
129130
130131
1 column removed
131-
age
132+
133+
age
132134
"""
133135
).strip()
134136
== human_text(diff, "id")
@@ -145,11 +147,13 @@ def test_columns_and_rows_changed():
145147
2 columns added, 1 column removed, 1 row changed, 1 row added, 1 row removed
146148
147149
2 columns added
148-
age
149-
length
150+
151+
age
152+
length
150153
151154
1 column removed
152-
weight
155+
156+
weight
153157
154158
1 row changed
155159

0 commit comments

Comments
 (0)
Please sign in to comment.