Skip to content

Commit e92c8c5

Browse files
committed
Revert changes to cluecode_test_utils.CopyrightTest
* Do not rename summaries to tallies Reference: #2842 Signed-off-by: Jono Yang <jyang@nexb.com>
1 parent 34720c1 commit e92c8c5

File tree

3,150 files changed

+3213
-15443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,150 files changed

+3213
-15443
lines changed

tests/cluecode/cluecode_test_utils.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ class CopyrightTest(object):
6060
holders = attr.ib(default=attr.Factory(list))
6161
authors = attr.ib(default=attr.Factory(list))
6262

63-
holders_tallies = attr.ib(default=attr.Factory(list))
64-
copyrights_tallies = attr.ib(default=attr.Factory(list))
65-
authors_tallies = attr.ib(default=attr.Factory(list))
63+
holders_summary = attr.ib(default=attr.Factory(list))
64+
copyrights_summary = attr.ib(default=attr.Factory(list))
65+
authors_summary = attr.ib(default=attr.Factory(list))
6666

6767
expected_failures = attr.ib(default=attr.Factory(list))
6868
notes = attr.ib(default=None)
@@ -83,14 +83,14 @@ def __attrs_post_init__(self, *args, **kwargs):
8383
raise Exception(msg)
8484

8585
# fix counts to be ints: saneyaml loads everything as string
86-
for holders_tally in self.holders_tallies:
87-
holders_tally['count'] = int(holders_tally['count'])
86+
for holders_sum in self.holders_summary:
87+
holders_sum['count'] = int(holders_sum['count'])
8888

89-
for copyrs_tally in self.copyrights_tallies:
90-
copyrs_tally['count'] = int(copyrs_tally['count'])
89+
for copyrs_sum in self.copyrights_summary:
90+
copyrs_sum['count'] = int(copyrs_sum['count'])
9191

92-
for auths_tally in self.authors_tallies:
93-
auths_tally['count'] = int(auths_tally['count'])
92+
for auths_sum in self.authors_summary:
93+
auths_sum['count'] = int(auths_sum['count'])
9494

9595
def to_dict(self):
9696
"""
@@ -182,25 +182,25 @@ def closure_test_function(*args, **kwargs):
182182
detections = detect_copyrights(test_file)
183183
copyrights, holders, authors = Detection.split_values(detections)
184184

185-
holders_tallies = []
186-
if 'holders_tallies' in test.what:
187-
holders_tallies = as_sorted_mapping(tally_persons(holders))
185+
holders_summary = []
186+
if 'holders_summary' in test.what:
187+
holders_summary = as_sorted_mapping(tally_copyrights(holders))
188188

189-
copyrights_tallies = []
190-
if 'copyrights_tallies' in test.what:
191-
copyrights_tallies = as_sorted_mapping(tally_copyrights(copyrights))
189+
copyrights_summary = []
190+
if 'copyrights_summary' in test.what:
191+
copyrights_summary = as_sorted_mapping(tally_copyrights(copyrights))
192192

193-
authors_tallies = []
194-
if 'authors_tallies' in test.what:
195-
authors_tallies = as_sorted_mapping(tally_persons(authors))
193+
authors_summary = []
194+
if 'authors_summary' in test.what:
195+
authors_summary = as_sorted_mapping(tally_persons(authors))
196196

197197
results = dict(
198198
copyrights=copyrights,
199199
authors=authors,
200200
holders=holders,
201-
holders_tallies=holders_tallies,
202-
copyrights_tallies=copyrights_tallies,
203-
authors_tallies=authors_tallies,
201+
holders_summary=holders_summary,
202+
copyrights_summary=copyrights_summary,
203+
authors_summary=authors_summary,
204204
)
205205

206206
expected_yaml = test.dumps()
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
what:
22
- authors
3-
- authors_tallies
3+
- authors_summary
44
authors:
55
- Gordon Matzigkeit <gord@gnu.ai.mit.edu>
6-
authors_tallies:
6+
authors_summary:
77
- value: Gordon Matzigkeit <gord@gnu.ai.mit.edu>
88
count: 1
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
what:
22
- authors
3-
- authors_tallies
3+
- authors_summary
44
authors:
55
- John Doe
6-
authors_tallies:
6+
authors_summary:
77
- value: John Doe
88
count: 1
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
what:
22
- authors
3-
- authors_tallies
3+
- authors_summary
44
authors:
55
- Avinash Kak (kak@purdue.edu)
66
- Avinash Kak (kak@purdue.edu)
7-
authors_tallies:
7+
authors_summary:
88
- value: Avinash Kak (kak@purdue.edu)
99
count: 2
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
what:
22
- authors
3-
- authors_tallies
3+
- authors_summary
44
authors:
55
- Avinash Kak (kak@purdue.edu)
66
- Avinash Kak (kak@purdue.edu)
7-
authors_tallies:
7+
authors_summary:
88
- value: Avinash Kak (kak@purdue.edu)
99
count: 2
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
what:
22
- authors
3-
- authors_tallies
3+
- authors_summary
44
authors:
55
- the University of California, Berkeley and its contributors
6-
authors_tallies:
6+
authors_summary:
77
- value: the University of California, Berkeley and its contributors
88
count: 1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
what:
22
- authors
3-
- authors_tallies
3+
- authors_summary
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
what:
22
- authors
3-
- authors_tallies
3+
- authors_summary
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
what:
22
- authors
3-
- authors_tallies
3+
- authors_summary
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
what:
22
- authors
3-
- authors_tallies
3+
- authors_summary
44
authors:
55
- Gordon Matzigkeit
6-
authors_tallies:
6+
authors_summary:
77
- value: Gordon Matzigkeit
88
count: 1

0 commit comments

Comments
 (0)