Skip to content

Commit 60b3017

Browse files
committed
passed for test_score_no_copyright _no_copyright_changes
Signed-off-by: Pratikrocks <pratikrocks.dey11@gmail.com>
1 parent d64de2b commit 60b3017

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

tests/test_deltacode.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,8 @@ def test_score_no_copyright_info(self):
895895
assert [d.score for d in deltas_object if d.new_file.path == 'path.txt'] == [20]
896896
assert [d.factors for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
897897
assert [d.status for d in deltas_object if d.new_file.path == 'path.txt'] == ['modified']
898-
assert [d.to_dict().get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
899-
assert [d.to_dict().get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
898+
assert [d.to_dict(deltacode_object).get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
899+
assert [d.to_dict(deltacode_object).get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
900900

901901
assert len([i for i in deltas_object if i.score == 30]) == 0
902902
assert len([i for i in deltas_object if i.score == 20]) == 1
@@ -919,13 +919,13 @@ def test_score_no_copyright_changes(self):
919919
assert [d.score for d in deltas_object if d.new_file.path == 'path.txt'] == [20]
920920
assert [d.factors for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
921921
assert [d.status for d in deltas_object if d.new_file.path == 'path.txt'] == ['modified']
922-
assert [d.to_dict().get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
922+
assert [d.to_dict(deltacode_object).get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
923923
OrderedDict([
924924
('statements', ['Copyright (c) 2016 Mark Adler']),
925925
('holders', ['Mark Adler'])
926926
])
927927
]
928-
assert [d.to_dict().get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
928+
assert [d.to_dict(deltacode_object).get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
929929
OrderedDict([
930930
('statements', ['Copyright (c) 2016 Mark Adler']),
931931
('holders', ['Mark Adler'])
@@ -953,8 +953,8 @@ def test_score_no_copyright_key(self):
953953
assert [d.score for d in deltas_object if d.new_file.path == 'path.txt'] == [20]
954954
assert [d.factors for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
955955
assert [d.status for d in deltas_object if d.new_file.path == 'path.txt'] == ['modified']
956-
assert [d.to_dict().get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
957-
assert [d.to_dict().get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
956+
assert [d.to_dict(deltacode_object).get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
957+
assert [d.to_dict(deltacode_object).get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
958958

959959
assert len([i for i in deltas_object if i.score == 30]) == 0
960960
assert len([i for i in deltas_object if i.score == 20]) == 1
@@ -977,15 +977,15 @@ def test_score_copyright_and_license_info_added(self):
977977
assert [d.score for d in deltas_object if d.new_file.path == 'path.txt'] == [70]
978978
assert [d.factors for d in deltas_object if d.new_file.path == 'path.txt'].pop() == ['license info added', 'copyleft added', 'copyright info added']
979979
assert [d.status for d in deltas_object if d.new_file.path == 'path.txt'] == ['modified']
980-
assert [d.to_dict().get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
981-
assert [d.to_dict().get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
980+
assert [d.to_dict(deltacode_object).get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
981+
assert [d.to_dict(deltacode_object).get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
982982
OrderedDict([
983983
('statements', ['Copyright (c) 2016 Mark Adler']),
984984
('holders', ['Mark Adler'])
985985
])
986986
]
987-
assert [d.to_dict().get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
988-
assert [d.to_dict().get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
987+
assert [d.to_dict(deltacode_object).get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
988+
assert [d.to_dict(deltacode_object).get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
989989
OrderedDict([
990990
('key', 'gpl-1.0-plus'),
991991
('score', 20.0),
@@ -1018,14 +1018,14 @@ def test_score_copyright_and_license_info_removed(self):
10181018
assert [d.score for d in deltas_object if d.new_file.path == 'path.txt'] == [45]
10191019
assert [d.factors for d in deltas_object if d.new_file.path == 'path.txt'].pop() == ['license info removed', 'copyright info removed']
10201020
assert [d.status for d in deltas_object if d.new_file.path == 'path.txt'] == ['modified']
1021-
assert [d.to_dict().get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1021+
assert [d.to_dict(deltacode_object).get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
10221022
OrderedDict([
10231023
('statements', ['Copyright (c) 2016 Mark Adler']),
10241024
('holders', ['Mark Adler'])
10251025
])
10261026
]
1027-
assert [d.to_dict().get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
1028-
assert [d.to_dict().get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1027+
assert [d.to_dict(deltacode_object).get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
1028+
assert [d.to_dict(deltacode_object).get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
10291029
OrderedDict([
10301030
('key', 'gpl-1.0-plus'),
10311031
('score', 20.0),
@@ -1034,7 +1034,7 @@ def test_score_copyright_and_license_info_removed(self):
10341034
('owner', "Free Software Foundation (FSF)")
10351035
])
10361036
]
1037-
assert [d.to_dict().get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
1037+
assert [d.to_dict(deltacode_object).get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
10381038

10391039
assert len([i for i in deltas_object if i.score == 55]) == 0
10401040
assert len([i for i in deltas_object if i.score == 45]) == 1
@@ -1059,14 +1059,14 @@ def test_score_copyright_info_added_license_info_removed(self):
10591059
assert [d.score for d in deltas_object if d.new_file.path == 'path.txt'] == [45]
10601060
assert [d.factors for d in deltas_object if d.new_file.path == 'path.txt'].pop() == ['license info removed', 'copyright info added']
10611061
assert [d.status for d in deltas_object if d.new_file.path == 'path.txt'] == ['modified']
1062-
assert [d.to_dict().get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
1063-
assert [d.to_dict().get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1062+
assert [d.to_dict(deltacode_object).get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
1063+
assert [d.to_dict(deltacode_object).get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
10641064
OrderedDict([
10651065
('statements', ['Copyright (c) 2016 Mark Adler']),
10661066
('holders', ['Mark Adler'])
10671067
])
10681068
]
1069-
assert [d.to_dict().get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1069+
assert [d.to_dict(deltacode_object).get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
10701070
OrderedDict([
10711071
('key', 'gpl-3.0-plus'),
10721072
('score', 100.0),
@@ -1075,7 +1075,7 @@ def test_score_copyright_info_added_license_info_removed(self):
10751075
('owner', "Free Software Foundation (FSF)")
10761076
])
10771077
]
1078-
assert [d.to_dict().get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
1078+
assert [d.to_dict(deltacode_object).get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
10791079

10801080
assert len([i for i in deltas_object if i.score == 55]) == 0
10811081
assert len([i for i in deltas_object if i.score == 50]) == 0
@@ -1101,15 +1101,15 @@ def test_score_license_info_added_copyright_info_removed(self):
11011101
assert [d.score for d in deltas_object if d.new_file.path == 'path.txt'] == [70]
11021102
assert [d.factors for d in deltas_object if d.new_file.path == 'path.txt'].pop() == ['license info added', 'copyleft added', 'copyright info removed']
11031103
assert [d.status for d in deltas_object if d.new_file.path == 'path.txt'] == ['modified']
1104-
assert [d.to_dict().get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1104+
assert [d.to_dict(deltacode_object).get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
11051105
OrderedDict([
11061106
('statements', ['Copyright (c) 2016 Mark Adler']),
11071107
('holders', ['Mark Adler'])
11081108
])
11091109
]
1110-
assert [d.to_dict().get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
1111-
assert [d.to_dict().get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
1112-
assert [d.to_dict().get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1110+
assert [d.to_dict(deltacode_object).get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
1111+
assert [d.to_dict(deltacode_object).get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == []
1112+
assert [d.to_dict(deltacode_object).get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
11131113
OrderedDict([
11141114
('key', 'gpl-3.0-plus'),
11151115
('score', 100.0),
@@ -1143,19 +1143,19 @@ def test_score_copyright_change_no_license_change(self):
11431143
assert [d.score for d in deltas_object if d.new_file.path == 'path.txt'] == [25]
11441144
assert [d.factors for d in deltas_object if d.new_file.path == 'path.txt'].pop() == ['copyright change']
11451145
assert [d.status for d in deltas_object if d.new_file.path == 'path.txt'] == ['modified']
1146-
assert [d.to_dict().get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1146+
assert [d.to_dict(deltacode_object).get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
11471147
OrderedDict([
11481148
('statements', ['Copyright (c) 2016 Mark Adler']),
11491149
('holders', ['Mark Adler'])
11501150
])
11511151
]
1152-
assert [d.to_dict().get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1152+
assert [d.to_dict(deltacode_object).get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
11531153
OrderedDict([
11541154
('statements', ['Copyright (c) 2016 Alfred E. Neuman']),
11551155
('holders', ['Alfred E. Neuman'])
11561156
])
11571157
]
1158-
assert [d.to_dict().get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1158+
assert [d.to_dict(deltacode_object).get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
11591159
OrderedDict([
11601160
('key', 'gpl-3.0-plus'),
11611161
('score', 100.0),
@@ -1164,7 +1164,7 @@ def test_score_copyright_change_no_license_change(self):
11641164
('owner', "Free Software Foundation (FSF)")
11651165
])
11661166
]
1167-
assert [d.to_dict().get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1167+
assert [d.to_dict(deltacode_object).get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
11681168
OrderedDict([
11691169
('key', 'gpl-3.0-plus'),
11701170
('score', 100.0),
@@ -1196,19 +1196,19 @@ def test_score_license_change_no_copyright_change(self):
11961196
assert [d.score for d in deltas_object if d.new_file.path == 'path.txt'] == [30]
11971197
assert [d.factors for d in deltas_object if d.new_file.path == 'path.txt'].pop() == ['license change']
11981198
assert [d.status for d in deltas_object if d.new_file.path == 'path.txt'] == ['modified']
1199-
assert [d.to_dict().get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1199+
assert [d.to_dict(deltacode_object).get('old').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
12001200
OrderedDict([
12011201
('statements', ['Copyright (c) 2016 Mark Adler']),
12021202
('holders', ['Mark Adler'])
12031203
])
12041204
]
1205-
assert [d.to_dict().get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1205+
assert [d.to_dict(deltacode_object).get('new').get('copyrights') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
12061206
OrderedDict([
12071207
('statements', ['Copyright (c) 2016 Mark Adler']),
12081208
('holders', ['Mark Adler'])
12091209
])
12101210
]
1211-
assert [d.to_dict().get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1211+
assert [d.to_dict(deltacode_object).get('old').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
12121212
OrderedDict([
12131213
('key', 'gpl-3.0-plus'),
12141214
('score', 100.0),
@@ -1217,7 +1217,7 @@ def test_score_license_change_no_copyright_change(self):
12171217
('owner', "Free Software Foundation (FSF)")
12181218
])
12191219
]
1220-
assert [d.to_dict().get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
1220+
assert [d.to_dict(deltacode_object).get('new').get('licenses') for d in deltas_object if d.new_file.path == 'path.txt'].pop() == [
12211221
OrderedDict([
12221222
('key', 'gpl-1.0-plus'),
12231223
('score', 20.0),

0 commit comments

Comments
 (0)