@@ -250,11 +250,11 @@ def test_DeltaCode_license_modified_low_score(self):
250250
251251 deltas = result .deltas
252252
253- assert len ([i for i in deltas if i .score == 30 ]) == 0
254- assert len ([i for i in deltas if i .score == 20 ]) == 2
253+ assert len ([i for i in deltas if i .score == 30 ]) == 2
254+ assert len ([i for i in deltas if i .score == 20 ]) == 0
255255
256- assert [d .score for d in deltas if d .new_file .path == 'some/path/a/a1.py' ] == [20 ]
257- assert [d .score for d in deltas if d .new_file .path == 'some/path/b/b1.py' ] == [20 ]
256+ assert [d .score for d in deltas if d .new_file .path == 'some/path/a/a1.py' ] == [30 ]
257+ assert [d .score for d in deltas if d .new_file .path == 'some/path/b/b1.py' ] == [30 ]
258258
259259 def test_DeltaCode_license_modified (self ):
260260 new_scan = self .get_test_loc ('deltacode/scan_modified_new_license_added.json' )
@@ -329,21 +329,6 @@ def test_Delta_modified_license_added(self):
329329 assert [d .score for d in deltas if d .new_file .path == 'some/path/b/b1.py' ] == [30 ]
330330 assert [d .score for d in deltas if d .new_file .path == 'some/path/c/c1.py' ] == [20 ]
331331
332- def test_Delta_modified_license_added_low_score (self ):
333- new_scan = self .get_test_loc ('deltacode/scan_modified_new_license_added_low_score.json' )
334- old_scan = self .get_test_loc ('deltacode/scan_modified_old_license_added_low_score.json' )
335-
336- options = OrderedDict ([
337- ('--all-delta-types' , False )
338- ])
339-
340- result = DeltaCode (new_scan , old_scan , options )
341-
342- deltas = result .deltas
343-
344- assert [d .score for d in deltas if d .new_file .path == 'some/path/a/a1.py' ] == [20 ]
345- assert [d .score for d in deltas if d .new_file .path == 'some/path/b/b1.py' ] == [20 ]
346-
347332 def test_Delta_modified_no_license_changes (self ):
348333 new_scan = self .get_test_loc ('deltacode/scan_modified_new_no_license_changes.json' )
349334 old_scan = self .get_test_loc ('deltacode/scan_modified_old_no_license_changes.json' )
@@ -847,8 +832,8 @@ def test_score_new_lic_below_cutoff_score(self):
847832 assert [d .old_file .sha1 for d in deltas_object if d .old_file .path == 'path.txt' ] == ['b' ]
848833 assert [d .new_file .sha1 for d in deltas_object if d .new_file .path == 'path.txt' ] == ['b_modified' ]
849834
850- assert [d .score for d in deltas_object if d .new_file .path == 'path.txt' ] == [30 ]
851- assert [d .factors for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == ['modified' , 'license change' ]
835+ assert [d .score for d in deltas_object if d .new_file .path == 'path.txt' ] == [20 ]
836+ assert [d .factors for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == ['modified' ]
852837 assert [d .to_dict ().get ('old' ).get ('licenses' ) for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == [
853838 OrderedDict ([
854839 ('key' , 'mit' ),
@@ -888,8 +873,8 @@ def test_score_old_lic_below_cutoff_score(self):
888873 assert [d .old_file .sha1 for d in deltas_object if d .old_file .path == 'path.txt' ] == ['b' ]
889874 assert [d .new_file .sha1 for d in deltas_object if d .new_file .path == 'path.txt' ] == ['b_modified' ]
890875
891- assert [d .score for d in deltas_object if d .new_file .path == 'path.txt' ] == [30 ]
892- assert [d .factors for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == ['modified' , 'license change' ]
876+ assert [d .score for d in deltas_object if d .new_file .path == 'path.txt' ] == [20 ]
877+ assert [d .factors for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == ['modified' ]
893878 assert [d .to_dict ().get ('old' ).get ('licenses' ) for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == [
894879 OrderedDict ([
895880 ('key' , 'mit' ),
@@ -1018,8 +1003,8 @@ def test_score_multiple_lic_keys_new_below_cutoff_score(self):
10181003 assert [d .old_file .sha1 for d in deltas_object if d .old_file .path == 'path.txt' ] == ['b' ]
10191004 assert [d .new_file .sha1 for d in deltas_object if d .new_file .path == 'path.txt' ] == ['b_modified' ]
10201005
1021- assert [d .score for d in deltas_object if d .new_file .path == 'path.txt' ] == [20 ]
1022- assert [d .factors for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == ['modified' ]
1006+ assert [d .score for d in deltas_object if d .new_file .path == 'path.txt' ] == [30 ]
1007+ assert [d .factors for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == ['modified' , 'license change' ]
10231008 assert [d .to_dict ().get ('old' ).get ('licenses' ) for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == [
10241009 OrderedDict ([
10251010 ('key' , 'mit' ),
@@ -1073,8 +1058,8 @@ def test_score_multiple_lic_keys_old_below_cutoff_score(self):
10731058 assert [d .old_file .sha1 for d in deltas_object if d .old_file .path == 'path.txt' ] == ['b' ]
10741059 assert [d .new_file .sha1 for d in deltas_object if d .new_file .path == 'path.txt' ] == ['b_modified' ]
10751060
1076- assert [d .score for d in deltas_object if d .new_file .path == 'path.txt' ] == [20 ]
1077- assert [d .factors for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == ['modified' ]
1061+ assert [d .score for d in deltas_object if d .new_file .path == 'path.txt' ] == [30 ]
1062+ assert [d .factors for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == ['modified' , 'license change' ]
10781063 assert [d .to_dict ().get ('old' ).get ('licenses' ) for d in deltas_object if d .new_file .path == 'path.txt' ].pop () == [
10791064 OrderedDict ([
10801065 ('key' , 'gpl-2.0' ),
0 commit comments