@@ -20,51 +20,51 @@ class TestTextPreparation(FileBasedTesting):
20
20
21
21
def test_strip_leading_numbers (self ):
22
22
a = '2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32'
23
- assert a == copyrights_module .strip_leading_numbers (a )
23
+ assert copyrights_module .strip_leading_numbers (a ) == a
24
24
25
25
a = '26 6 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on 12'
26
26
expected = '2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on 12'
27
- assert expected == copyrights_module .strip_leading_numbers (a )
27
+ assert copyrights_module .strip_leading_numbers (a ) == expected
28
28
29
29
def test_prepare_text_line (self ):
30
30
cp = 'test (C) all rights reserved'
31
31
result = copyrights_module .prepare_text_line (cp )
32
- assert 'test (c) all rights reserved' == result
32
+ assert result == 'test (c) all rights reserved'
33
33
34
34
def test_prepare_text_line_debian (self ):
35
35
cp = 'Parts Copyright (c) 1992 <s>Uri Blumentha<s>l, I</s>BM</s>'
36
36
result = copyrights_module .prepare_text_line (cp )
37
- assert 'Parts Copyright (c) 1992 Uri Blumenthal, IBM' == result
37
+ assert result == 'Parts Copyright (c) 1992 Uri Blumenthal, IBM'
38
38
39
39
def test_prepare_text_line_does_not_truncate_transliterable_unicode (self ):
40
40
cp = u'Muła'
41
41
result = copyrights_module .prepare_text_line (cp )
42
- assert 'Mula' == result
42
+ assert result == 'Mula'
43
43
44
44
def test_strip_markup (self ):
45
45
cp = 'Parts Copyright (c) 1992 <s>Uri Blumentha<s>l, I</s>BM</s>'
46
46
result = copyrights_module .strip_markup (cp )
47
- assert 'Parts Copyright (c) 1992 Uri Blumenthal, IBM' == result
47
+ assert result == 'Parts Copyright (c) 1992 Uri Blumenthal, IBM'
48
48
49
49
def test_prepare_text_line_removes_C_comments (self ):
50
50
cp = '/* Copyright 1996-2005, 2008-2011 by */'
51
51
result = copyrights_module .prepare_text_line (cp )
52
- assert 'Copyright 1996-2005, 2008-2011 by' == result
52
+ assert result == 'Copyright 1996-2005, 2008-2011 by'
53
53
54
54
def test_prepare_text_line_removes_C_comments2 (self ):
55
55
cp = '/* David Turner, Robert Wilhelm, and Werner Lemberg. */'
56
56
result = copyrights_module .prepare_text_line (cp )
57
- assert 'David Turner, Robert Wilhelm, and Werner Lemberg.' == result
57
+ assert result == 'David Turner, Robert Wilhelm, and Werner Lemberg.'
58
58
59
59
def test_prepare_text_line_removes_Cpp_comments (self ):
60
60
cp = '// David Turner, Robert Wilhelm, and Werner Lemberg. */'
61
61
result = copyrights_module .prepare_text_line (cp )
62
- assert 'David Turner, Robert Wilhelm, and Werner Lemberg.' == result
62
+ assert result == 'David Turner, Robert Wilhelm, and Werner Lemberg.'
63
63
64
64
def test_prepare_text_line_does_not_damage_urls (self ):
65
65
cp = 'copyright (c) 2000 World Wide Web Consortium, http://www.w3.org'
66
66
result = copyrights_module .prepare_text_line (cp )
67
- assert 'copyright (c) 2000 World Wide Web Consortium, http://www.w3.org' == result
67
+ assert result == 'copyright (c) 2000 World Wide Web Consortium, http://www.w3.org'
68
68
69
69
def test_is_end_of_statement (self ):
70
70
line = ''' "All rights reserved\\ n"'''
@@ -75,7 +75,7 @@ def test_candidate_lines_simple(self):
75
75
lines = [(1 , ' test (C) all rights reserved' )]
76
76
result = list (copyrights_module .candidate_lines (lines ))
77
77
expected = [[(1 , ' test (C) all rights reserved' )]]
78
- assert expected == result
78
+ assert result == expected
79
79
80
80
def test_candidate_lines_complex (self ):
81
81
lines = '''
@@ -119,7 +119,7 @@ def test_candidate_lines_complex(self):
119
119
]
120
120
121
121
result = list (copyrights_module .candidate_lines (enumerate (lines , 1 )))
122
- assert expected == result
122
+ assert result == expected
123
123
124
124
def test_is_candidates_should_not_select_line_with_bare_full_year (self ):
125
125
line = '2012'
@@ -204,7 +204,7 @@ def test_detect(self):
204
204
'(c) 2008' ,
205
205
]
206
206
copyrights , _ , _ = cluecode_test_utils .copyright_detector (location )
207
- assert expected == copyrights
207
+ assert copyrights == expected
208
208
209
209
def test_detect_with_lines (self ):
210
210
location = self .get_test_loc ('copyrights_basic/essential_smoke-ibm_c.c' )
@@ -216,7 +216,7 @@ def test_detect_with_lines(self):
216
216
('copyrights' , u'(c) 2008' , 8 , 8 )
217
217
]
218
218
results = list (copyrights_module .detect_copyrights (location ))
219
- assert expected == results
219
+ assert results == expected
220
220
221
221
def test_detect_with_lines_only_holders (self ):
222
222
location = self .get_test_loc ('copyrights_basic/essential_smoke-ibm_c.c' )
@@ -225,7 +225,7 @@ def test_detect_with_lines_only_holders(self):
225
225
('holders' , u'Eclipse, IBM and others' , 8 , 8 )
226
226
]
227
227
results = list (copyrights_module .detect_copyrights (location , copyrights = False , authors = False ))
228
- assert expected == results
228
+ assert results == expected
229
229
230
230
231
231
def check_detection_with_lines (expected , test_file ):
@@ -241,7 +241,7 @@ def check_detection_with_lines(expected, test_file):
241
241
)
242
242
243
243
results = [(statement , start , end ) for _t , statement , start , end in detections ]
244
- assert expected == results
244
+ assert results == expected
245
245
246
246
247
247
class TestCopyrightLinesDetection (FileBasedTesting ):
0 commit comments