/
test_copyrights.py
4029 lines (3552 loc) · 182 KB
/
test_copyrights.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use this software except in compliance with the License.
# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
# When you publish or redistribute any data created with ScanCode or any ScanCode
# derivative work, you must accompany this data with the following acknowledgment:
#
# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES
# OR CONDITIONS OF ANY KIND, either express or implied. No content created from
# ScanCode should be considered or used as legal advice. Consult an Attorney
# for any legal advice.
# ScanCode is a free software code scanning tool from nexB Inc. and others.
# Visit https://github.com/nexB/scancode-toolkit/ for support and download.
from __future__ import absolute_import, print_function
import os.path
from unittest.case import expectedFailure
from commoncode.testcase import FileBasedTesting
from cluecode_assert_utils import check_detection
import cluecode.copyrights
class TestTextPreparation(FileBasedTesting):
test_data_dir = os.path.join(os.path.dirname(__file__), 'data')
def test_strip_numbers(self):
a = 'Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32'
expected = u'Python 2.6.6 (r266:84297, Aug 2010, 18:46:32) [MSC v.1500 bit (Intel)] on win32'
assert expected == cluecode.copyrights.strip_numbers(a)
def test_prepare_text(self):
cp = ''' test (C) all rights reserved'''
result = cluecode.copyrights.prepare_text_line(cp)
assert 'test (c) all rights reserved' == result
def test_is_all_rights_reserved(self):
line = ''' "All rights reserved\\n"'''
assert cluecode.copyrights.is_all_rights_reserved(line)
def test_candidate_lines_simple(self):
lines = ''' test (C) all rights reserved'''.splitlines(False)
result = list(cluecode.copyrights.candidate_lines(lines))
expected = [[(1, ' test (C) all rights reserved')]]
assert expected == result
def test_candidate_lines_complex(self):
lines = '''
Apache Xalan (Xalan XSLT processor)
Copyright 1999-2006 The Apache Software Foundation
Apache Xalan (Xalan serializer)
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
=========================================================================
Portions of this software was originally based on the following:
- software copyright (c) 1999-2002, Lotus Development Corporation.,
http://www.lotus.com.
- software copyright (c) 2001-2002, Sun Microsystems.,
http://www.sun.com.
- software copyright (c) 2003, IBM Corporation.,
http://www.ibm.com.
=========================================================================
The binary distribution package (ie. jars, samples and documentation) of
this product includes software developed by the following:
'''.splitlines(False)
expected = [
[(2, ' Apache Xalan (Xalan XSLT processor)'),
(3, ' Copyright 1999-2006 The Apache Software Foundation')],
[(7, ' This product includes software developed at'),
(8, ' The Apache Software Foundation (http://www.apache.org/).')],
[(12, ' Portions of this software was originally based on the following:'),
(13, ' - software copyright (c) 1999-2002, Lotus Development Corporation.,'),
(14, ' http://www.lotus.com.'),
(15, ' - software copyright (c) 2001-2002, Sun Microsystems.,'),
(16, ' http://www.sun.com.'),
(17, ' - software copyright (c) 2003, IBM Corporation.,'),
(18, ' http://www.ibm.com.')],
[(21, ' The binary distribution package (ie. jars, samples and documentation) of'),
(22, ' this product includes software developed by the following:')]
]
result = list(cluecode.copyrights.candidate_lines(lines))
assert expected == result
class TestCopyrightDetector(FileBasedTesting):
test_data_dir = os.path.join(os.path.dirname(__file__), 'data')
def test_copyright_detect(self):
location = self.get_test_loc('copyrights/copyright_essential_smoke-ibm_c.c')
expected = [
u'Copyright IBM and others (c) 2008',
u'Copyright Eclipse, IBM and others (c) 2008'
]
copyrights, _, _, _ = cluecode.copyrights.detect(location)
assert expected == copyrights
class TestCopyrightDetection(FileBasedTesting):
test_data_dir = os.path.join(os.path.dirname(__file__), 'data')
def test_company_name_in_java(self):
test_file = self.get_test_loc('copyrights/company_name_in_java-9_java.java')
expected = [
u'Copyright (c) 2008-2011 Company Name Incorporated',
]
check_detection(expected, test_file)
def test_copyright_03e16f6c_0(self):
test_file = self.get_test_loc('copyrights/copyright_03e16f6c_0-e_f_c.0')
expected = [
u'Copyright (c) 1997 Microsoft Corp.',
u'Copyright (c) 1997 Microsoft Corp.',
u'(c) 1997 Microsoft',
]
check_detection(expected, test_file,
expected_in_results=True,
results_in_expected=False)
def test_copyright_3a3b02ce_0(self):
# this is a certificate and the actual copyright holder is not clear:
# could be either Wisekey or OISTE Foundation.
test_file = self.get_test_loc('copyrights/copyright_3a3b02ce_0-a_b_ce.0')
expected = [
u'Copyright (c) 2005, OU OISTE Foundation',
u'Copyright (c) 2005, OU OISTE Foundation',
]
check_detection(expected, test_file)
def test_copyright_ABC_cpp(self):
test_file = self.get_test_loc('copyrights/copyright_ABC_cpp-Case_cpp.cpp')
expected = [
u'Copyright (c) ABC Company',
]
check_detection(expected, test_file)
def test_copyright_ABC_file_cpp(self):
test_file = self.get_test_loc('copyrights/copyright_ABC_file_cpp-File_cpp.cpp')
expected = [
u'Copyright (c) ABC Company',
]
check_detection(expected, test_file)
def test_copyright_false_positive_in_c(self):
test_file = self.get_test_loc('copyrights/copyright_false_positive_in_c-false_positives_c.c')
expected = []
check_detection(expected, test_file)
def test_copyright_false_positive_in_js(self):
test_file = self.get_test_loc('copyrights/copyright_false_positive_in_js-editor_beta_de_js.js')
expected = []
check_detection(expected, test_file)
def test_copyright_false_positive_in_license(self):
test_file = self.get_test_loc('copyrights/copyright_false_positive_in_license-LICENSE')
expected = []
check_detection(expected, test_file)
def test_copyright_heunrich_c(self):
test_file = self.get_test_loc('copyrights/copyright_heunrich_c-c.c')
expected = [
u'Copyright (c) 2000 HEUNRICH HERTZ INSTITUTE',
]
check_detection(expected, test_file)
def test_copyright_isc(self):
test_file = self.get_test_loc('copyrights/copyright_isc-c.c')
expected = [
u'Copyright (c) 1998-2000 The Internet Software Consortium.',
]
check_detection(expected, test_file)
def test_copyright_json_phps_html_incorrect(self):
test_file = self.get_test_loc('copyrights/copyright_json_phps_html_incorrect-JSON_phps_html.html')
expected = []
check_detection(expected, test_file)
def test_copyright_no_copyright_in_class_file_1(self):
test_file = self.get_test_loc('copyrights/copyright_no_copyright_in_class_file_1-PersistentArrayHolder_class.class')
expected = []
check_detection(expected, test_file)
def test_copyright_sample_py(self):
test_file = self.get_test_loc('copyrights/copyright_sample_py-py.py')
expected = [
u'COPYRIGHT 2006 ABC',
]
check_detection(expected, test_file)
def test_copyright_abc(self):
test_file = self.get_test_loc('copyrights/copyright_abc')
expected = [
u'Copyright (c) 2006 abc.org',
]
check_detection(expected, test_file)
def test_copyright_abc_loss_of_holder_c(self):
test_file = self.get_test_loc('copyrights/copyright_abc_loss_of_holder_c-c.c')
expected = [
u'copyright abc 2001',
]
check_detection(expected, test_file)
def test_copyright_abiword_common_copyright(self):
test_file = self.get_test_loc('copyrights/copyright_abiword_common_copyright-abiword_common_copyright.copyright')
expected = [
u'Copyright (c) 1998- AbiSource, Inc.',
u'Copyright (c) 2009 Masayuki Hatta',
u'Copyright (c) 2009 Patrik Fimml <patrik@fimml.at>',
]
check_detection(expected, test_file)
def test_copyright_acme_c(self):
test_file = self.get_test_loc('copyrights/copyright_acme_c-c.c')
expected = [
u'Copyright (c) 2000 ACME, Inc.',
]
check_detection(expected, test_file)
def test_copyright_activefieldattribute_cs(self):
test_file = self.get_test_loc('copyrights/copyright_activefieldattribute_cs-ActiveFieldAttribute_cs.cs')
expected = [
u'Web Applications Copyright 2009 - Thomas Hansen thomas@ra-ajax.org.',
]
check_detection(expected, test_file)
def test_copyright_addr_c(self):
test_file = self.get_test_loc('copyrights/copyright_addr_c-addr_c.c')
expected = [
u'Copyright 1999 Cornell University.',
u'Copyright 2000 Jon Doe.',
]
check_detection(expected, test_file)
def test_copyright_apostrophe_in_name(self):
test_file = self.get_test_loc('copyrights/copyright_with_apos.txt')
expected = [
u"Copyright Marco d'Itri <md@Linux.IT>",
u"Copyright Marco d'Itri",
]
check_detection(expected, test_file)
def test_copyright_adler_inflate_c(self):
test_file = self.get_test_loc('copyrights/copyright_adler_inflate_c-inflate_c.c')
expected = [
u'Not copyrighted 1992 by Mark Adler',
]
check_detection(expected, test_file)
def test_copyright_adobe_flashplugin_copyright_label(self):
test_file = self.get_test_loc('copyrights/copyright_adobe_flashplugin_copyright_label-adobe_flashplugin_copyright_label.label')
expected = [
u'Copyright (c) 1996 - 2008. Adobe Systems Incorporated',
u'(c) 2001-2009, Takuo KITAME, Bart Martens, and Canonical, LTD',
]
check_detection(expected, test_file,
expected_in_results=False,
results_in_expected=True)
def test_copyright_aleal(self):
test_file = self.get_test_loc('copyrights/copyright_aleal-c.c')
expected = [
u'copyright (c) 2006 by aleal',
]
check_detection(expected, test_file)
def test_copyright_andre_darcy(self):
test_file = self.get_test_loc('copyrights/copyright_andre_darcy-c.c')
expected = [
u'Copyright (c) 1995, Pascal Andre (andre@via.ecp.fr).',
u"copyright 1997, 1998, 1999 by D'Arcy J.M. Cain (darcy@druid.net)",
]
check_detection(expected, test_file)
def test_copyright_android_c(self):
test_file = self.get_test_loc('copyrights/copyright_android_c-c.c')
expected = [
u'Copyright (c) 2009 The Android Open Source Project',
u'Copyright 2003-2005 Colin Percival',
]
check_detection(expected, test_file)
def test_copyright_apache2_debian_trailing_name_missed(self):
test_file = self.get_test_loc('copyrights/copyright_apache2_debian_trailing_name_missed-apache_copyright_label.label')
expected = [
u'copyright Steinar H. Gunderson <sgunderson@bigfoot.com> and Knut Auvor Grythe <knut@auvor.no>',
u'Copyright (c) 1996-1997 Cisco Systems, Inc.',
u'Copyright (c) Ian F. Darwin',
u'Copyright (c) Ian F. Darwin 1986, 1987, 1989, 1990, 1991, 1992, 1994, 1995.',
u'copyright 1992 by Eric Haines, erich@eye.com',
u'Copyright (c) 1995, Board of Trustees of the University of Illinois',
u'Copyright (c) 1994, Jeff Hostetler, Spyglass, Inc.',
u'Copyright (c) 1993, 1994 by Carnegie Mellon University',
u'Copyright (c) 1991 Bell Communications Research, Inc.',
u'(c) Copyright 1993,1994 by Carnegie Mellon University',
u'Copyright (c) 1991 Bell Communications Research, Inc.',
u'Copyright RSA Data Security, Inc.',
u'Copyright (c) 1991-2, RSA Data Security, Inc.',
u'Copyright RSA Data Security, Inc.',
u'Copyright (c) 1991-2, RSA Data Security, Inc.',
u'copyright RSA Data Security, Inc.',
u'Copyright (c) 1991-2, RSA Data Security, Inc.',
u'copyright RSA Data Security, Inc.',
u'Copyright (c) 1991-2, RSA Data Security, Inc.',
u'Copyright (c) 2000-2002 The Apache Software Foundation',
u'copyright RSA Data Security, Inc.',
u'Copyright (c) 1990-2, RSA Data Security, Inc.',
u'Copyright 1991 by the Massachusetts Institute of Technology',
u'Copyright 1991 by the Massachusetts Institute of Technology',
u'Copyright (c) 1997-2001 University of Cambridge',
u'copyright by the University of Cambridge, England.',
u'Copyright (c) Zeus Technology Limited 1996.',
u'Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper',
u'copyright of Pete Harlow'
]
check_detection(expected, test_file)
def test_copyright_apache_notice(self):
test_file = self.get_test_loc('copyrights/copyright_apache_notice-NOTICE')
expected = [
u'Copyright 1999-2006 The Apache Software Foundation',
u'Copyright 1999-2006 The Apache Software Foundation',
u'Copyright 2001-2003,2006 The Apache Software Foundation.',
u'copyright (c) 2000 World Wide Web Consortium',
]
check_detection(expected, test_file)
def test_copyright_aptitude_copyright_label(self):
test_file = self.get_test_loc('copyrights/copyright_aptitude_copyright_label-aptitude_copyright_label.label')
expected = [
u'Copyright 1999-2005 Daniel Burrows <dburrows@debian.org>',
]
check_detection(expected, test_file)
def test_copyright_atheros_spanning_lines(self):
test_file = self.get_test_loc('copyrights/copyright_atheros_spanning_lines-py.py')
expected = [
u'Copyright (c) 2000 Atheros Communications, Inc.',
u'Copyright (c) 2001 Atheros Communications, Inc.',
u'Copyright (c) 1994-1997 by Intel Corporation.',
]
check_detection(expected, test_file)
def test_copyright_att_in_c(self):
test_file = self.get_test_loc('copyrights/copyright_att_in_c-9_c.c')
expected = [
u'Copyright (c) 1991 by AT&T.',
]
check_detection(expected, test_file)
def test_copyright_audio_c(self):
test_file = self.get_test_loc('copyrights/copyright_audio_c-c.c')
expected = [
u'copyright (c) 1995, AudioCodes, DSP Group, France Telecom, Universite de Sherbrooke.',
]
check_detection(expected, test_file)
def test_copyright_babkin_txt(self):
test_file = self.get_test_loc('copyrights/copyright_babkin_txt.txt')
expected = [
u'Copyright (c) North',
u'Copyright (c) South',
u'Copyright (c) 2001 by the TTF2PT1 project',
u'Copyright (c) 2001 by Sergey Babkin',
]
check_detection(expected, test_file)
def test_copyright_blender_debian(self):
test_file = self.get_test_loc('copyrights/copyright_blender_debian-blender_copyright.copyright')
expected = [
u'Copyright (c) 2002-2008 Blender Foundation',
u'Copyright (c) 2004-2005 Masayuki Hatta <mhatta@debian.org>',
u'(c) 2005-2007 Florian Ernst <florian@debian.org>',
u'(c) 2007-2008 Cyril Brulebois <kibi@debian.org>',
]
check_detection(expected, test_file)
def test_copyright_blue_sky_dash_in_name(self):
test_file = self.get_test_loc('copyrights/copyright_blue_sky_dash_in_name-c.c')
expected = [
u'Copyright (c) 1995, 1996 - Blue Sky Software Corp. -',
]
check_detection(expected, test_file,
expected_in_results=False,
results_in_expected=True)
def test_copyright_bouncy_license(self):
test_file = self.get_test_loc('copyrights/copyright_bouncy_license-LICENSE')
expected = [
u'Copyright (c) 2000-2005 The Legion Of The Bouncy Castle',
]
check_detection(expected, test_file)
def test_copyright_bouncy_notice(self):
test_file = self.get_test_loc('copyrights/copyright_bouncy_notice-9_NOTICE')
expected = [
u'Copyright (c) 2000-2005 The Legion Of The Bouncy Castle',
]
check_detection(expected, test_file)
def test_copyright_btt_plot1_py(self):
test_file = self.get_test_loc('copyrights/copyright_btt_plot1_py-btt_plot_py.py')
expected = [
u'(c) Copyright 2009 Hewlett-Packard Development Company',
]
check_detection(expected, test_file)
def test_copyright_camelcase_bug_br_fcc_thread_psipstack_c(self):
test_file = self.get_test_loc('copyrights/copyright_camelcase_bug_br_fcc_thread_psipstack_c-br_fcc_thread_psipstack_c.c')
expected = [
u'Copyright 2010-2011 by BitRouter',
]
check_detection(expected, test_file)
def test_copyright_ccube_txt(self):
test_file = self.get_test_loc('copyrights/copyright_ccube_txt.txt')
expected = [
u'Copyright (c) 2001 C-Cube Microsystems.',
]
check_detection(expected, test_file)
def test_copyright_cedrik_java(self):
test_file = self.get_test_loc('copyrights/copyright_cedrik_java-java.java')
expected = [
u'copyright (c) 2005-2006 Cedrik LIME',
]
check_detection(expected, test_file,
expected_in_results=True,
results_in_expected=False)
def test_copyright_cern(self):
test_file = self.get_test_loc('copyrights/copyright_cern-TestMatrix_D_java.java')
expected = [
u'Copyright 1999 CERN - European Organization for Nuclear Research.',
]
check_detection(expected, test_file)
def test_copyright_cern_matrix2d_java(self):
test_file = self.get_test_loc('copyrights/copyright_cern_matrix2d_java-TestMatrix_D_java.java')
expected = [
u'Copyright 1999 CERN - European Organization for Nuclear Research.',
u'Copyright (c) 1998 Company PIERSOL Engineering Inc.',
u'Copyright (c) 1998 Company PIERSOL Engineering Inc.',
]
check_detection(expected, test_file)
def test_copyright_chameleon_assembly(self):
test_file = self.get_test_loc('copyrights/copyright_chameleon_assembly-9_9_setjmp_S.S')
expected = [
u'Copyright Chameleon Systems, 1999',
]
check_detection(expected, test_file)
def test_copyright_co_cust(self):
test_file = self.get_test_loc('copyrights/copyright_co_cust-copyright_java.java')
expected = [
u'Copyright (c) 2009 Company Customer Identity Hidden',
]
check_detection(expected, test_file)
def test_copyright_colin_android(self):
test_file = self.get_test_loc('copyrights/copyright_colin_android-bsdiff_c.c')
expected = [
u'Copyright (c) 2009 The Android Open Source Project',
u'Copyright 2003-2005 Colin Percival',
]
check_detection(expected, test_file)
def test_copyright_company_in_txt(self):
test_file = self.get_test_loc('copyrights/copyright_company_in_txt-9.txt')
expected = [
u'Copyright (c) 2008-2011 Company Name Incorporated',
]
check_detection(expected, test_file)
def test_copyright_complex_4_line_statement_in_text(self):
test_file = self.get_test_loc('copyrights/copyright_complex_4_line_statement_in_text-9.txt')
expected = [
u'Copyright 2002 Jonas Borgstrom <jonas@codefactory.se> 2002 Daniel Lundin <daniel@codefactory.se> 2002 CodeFactory AB',
u'Copyright (c) 1994 The Regents of the University of California',
]
check_detection(expected, test_file)
def test_copyright_complex_notice(self):
test_file = self.get_test_loc('copyrights/copyright_complex_notice-NOTICE')
expected = [
u'Copyright (c) 2003, Steven G. Kargl',
u'Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org>',
u'Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>',
u'Copyright (c) 2003 David Schultz <das@FreeBSD.ORG>',
u'Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>',
u'Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG>',
u'Copyright (c) 2005 David Schultz <das@FreeBSD.ORG>',
u'Copyright (c) 2002 David Schultz <das@FreeBSD.ORG>',
u'Copyright (c) 2004 Stefan Farfeleder',
u'Copyright (c) 2003 Dag-Erling Coidan Smrgrav',
u'Copyright (c) 1996 The NetBSD Foundation, Inc.',
u'Copyright (c) 1985, 1993',
u'Copyright (c) 1988, 1993',
u'Copyright (c) 1992, 1993 The Regents of the University of California.',
u'Copyright (c) 1993,94 Winning Strategies, Inc.',
u'Copyright (c) 1994 Winning Strategies, Inc.',
u'Copyright (c) 1993 by Sun Microsystems, Inc.',
u'Copyright (c) 1993 by Sun Microsystems, Inc.',
u'Copyright (c) 1993 by Sun Microsystems, Inc.',
u'Copyright (c) 2004 by Sun Microsystems, Inc.',
u'Copyright (c) 2004 Stefan Farfeleder',
u'Copyright (c) 2004 David Schultz <das@FreeBSD.org>',
u'Copyright (c) 2004, 2005 David Schultz <das@FreeBSD.org>',
u'Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org>',
u'Copyright (c) 2005 David Schultz <das@FreeBSD.org>',
u'Copyright (c) 2003, Steven G. Kargl',
u'Copyright (c) 1991 The Regents of the University of California.',
]
check_detection(expected, test_file)
def test_copyright_complex_notice_sun_microsystems_on_multiple_lines(self):
test_file = self.get_test_loc('copyrights/copyright_complex_notice_sun_microsystems_on_multiple_lines-NOTICE')
expected = [
u'Copyright 1999-2006 The Apache Software Foundation',
u'copyright (c) 1999-2002, Lotus Development',
u'copyright (c) 2001-2002, Sun Microsystems.',
u'copyright (c) 2003, IBM Corporation., http://www.ibm.com.',
u'copyright (c) 1999, IBM Corporation., http://www.ibm.com.',
u'copyright (c) 1999, Sun Microsystems.',
u'copyright (c) 1999, IBM Corporation., http://www.ibm.com.',
u'copyright (c) 1999, Sun Microsystems.',
]
check_detection(expected, test_file)
def test_copyright_config(self):
test_file = self.get_test_loc('copyrights/copyright_config-config_guess.guess')
expected = [
u'Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.',
]
check_detection(expected, test_file)
def test_copyright_config1_guess(self):
test_file = self.get_test_loc('copyrights/copyright_config1_guess-config_guess.guess')
expected = [
u'Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.',
]
check_detection(expected, test_file)
def test_copyright_copyright_camelcase_br_diagnostics_h(self):
test_file = self.get_test_loc('copyrights/copyright_copyright_camelcase_br_diagnostics_h-br_diagnostics_h.h')
expected = [
u'Copyright 2011 by BitRouter',
]
check_detection(expected, test_file)
def test_copyright_coreutils_debian(self):
test_file = self.get_test_loc('copyrights/copyright_coreutils_debian-coreutils_copyright.copyright')
expected = [
u'Copyright (c) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.',
u'Copyright (c) 1990, 1993, 1994 The Regents of the University of California',
u'Copyright (c) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.',
u'Copyright (c) 1989, 1993 The Regents of the University of California',
u'Copyright (c) 1999-2006 Free Software Foundation, Inc.',
u'Copyright (c) 1997, 1998, 1999 Colin Plumb',
u'Copyright (c) 2005, 2006 Free Software Foundation, Inc.',
u'Copyright (c) 1996-1999 by Internet Software Consortium',
u'Copyright (c) 2004, 2006, 2007 Free Software Foundation, Inc.',
u'Copyright (c) 1997-2007 Free Software Foundation, Inc.',
u'Copyright (c) 1984 David M. Ihnat',
u'Copyright (c) 1996-2007 Free Software Foundation, Inc.',
u'Copyright (c) 1994, 1995, 1997, 1998, 1999, 2000 H. Peter Anvin',
u'Copyright (c) 1997-2005 Free Software Foundation, Inc.',
u'Copyright (c) 1984 David M. Ihnat',
u'Copyright (c) 1999-2007 Free Software Foundation, Inc.',
u'Copyright (c) 1997, 1998, 1999 Colin Plumb',
u'Copyright 1994-1996, 2000-2008 Free Software Foundation, Inc.',
u'Copyright (c) 1984-2008 Free Software Foundation, Inc.',
]
check_detection(expected, test_file)
def test_copyright_dag_c(self):
test_file = self.get_test_loc('copyrights/copyright_dag_c-s_fabsl_c.c')
expected = [
u'Copyright (c) 2003 Dag-Erling Coidan Smrgrav',
]
check_detection(expected, test_file)
def test_copyright_dag_elring_notice(self):
test_file = self.get_test_loc('copyrights/copyright_dag_elring_notice-NOTICE')
expected = [
u'Copyright (c) 2003 Dag-Erling Codan Smrgrav',
]
check_detection(expected, test_file)
def test_copyright_dash_in_name(self):
test_file = self.get_test_loc('copyrights/copyright_dash_in_name-Makefile')
expected = [
u'(c) 2011 - Anycompany, LLC',
]
check_detection(expected, test_file,
expected_in_results=False,
results_in_expected=True)
def test_copyright_dasher_copyright_label(self):
test_file = self.get_test_loc('copyrights/copyright_dasher_copyright_label-dasher_copyright_label.label')
expected = [
u'Copyright (c) 1998-2008 The Dasher Project',
]
check_detection(expected, test_file)
def test_copyright_date_range_dahua_in_c(self):
test_file = self.get_test_loc('copyrights/copyright_date_range_dahua_in_c-c.c')
expected = [
u'(c) Copyright 2006 to 2007 Dahua Digital.',
]
check_detection(expected, test_file)
def test_copyright_date_range_in_c(self):
test_file = self.get_test_loc('copyrights/copyright_date_range_in_c-c.c')
expected = [
u'Copyright (c) ImageSilicon Tech. (2006 - 2007)',
]
check_detection(expected, test_file)
def test_copyright_date_range_in_c_2(self):
test_file = self.get_test_loc('copyrights/copyright_date_range_in_c_2-c.c')
expected = [
u'(c) Copyright 2005 to 2007 ImageSilicon? Tech.,ltd',
]
check_detection(expected, test_file)
def test_copyright_debian_archive_keyring_copyright(self):
test_file = self.get_test_loc('copyrights/copyright_debian_archive_keyring_copyright-debian_archive_keyring_copyright.copyright')
expected = [
u'Copyright (c) 2006 Michael Vogt <mvo@debian.org>',
]
check_detection(expected, test_file)
def test_copyright_debian_lib_1(self):
test_file = self.get_test_loc('copyrights/copyright_debian_lib_1-libmono_cairo_cil_copyright_label.label')
expected = [
u'Copyright 2004 The Apache Software Foundation',
u'Copyright (c) 2001-2005 Novell',
u'Copyright (c) Microsoft Corporation',
u'Copyright (c) 2007 James Newton-King',
u'Copyright (c) 2002-2004 James W. Newkirk , Michael C. Two , Alexei A. Vorontsov , Charlie Poole',
u'Copyright (c) 2000-2004 Philip A. Craig',
u'Portions Copyright (c) 2002-2004 James W. Newkirk , Michael C. Two , Alexei A. Vorontsov , Charlie Poole',
u'Copyright (c) 2000-2004 Philip A. Craig',
u'Copyright (c) 2007, 2008 LShift Ltd.',
u'Copyright (c) 2007, 2008 Cohesive Financial Technologies LLC.',
u'Copyright (c) 2007, 2008 Rabbit Technologies Ltd.',
u'Copyright (c) 2007, 2008 LShift Ltd. , Cohesive Financial Technologies', # LLC., and Rabbit Technologies Ltd.',
u'Copyright (c) 2007, 2008 LShift Ltd. , Cohesive Financial Technologies', # LLC., and Rabbit Technologies Ltd.',
u'Copyright (c) 2007 LShift Ltd. , Cohesive Financial Technologies', # LLC., and Rabbit Technologies Ltd.',
u'Copyright (c) ???? Simon Mourier <simonm@microsoft.com>',
]
check_detection(expected, test_file)
def test_copyright_debian_lib_2(self):
test_file = self.get_test_loc('copyrights/copyright_debian_lib_2-libmono_cairo_cil_copyright.copyright')
expected = [
u'Copyright 2004 The Apache Software Foundation',
u'Copyright (c) 2001-2005 Novell',
u'Copyright (c) Microsoft Corporation',
u'Copyright (c) 2007 James Newton-King',
u'Copyright (c) 2002-2004 James W. Newkirk , Michael C. Two , Alexei A. Vorontsov , Charlie Poole',
u'Copyright (c) 2000-2004 Philip A. Craig',
u'Portions Copyright (c) 2002-2004 James W. Newkirk , Michael C. Two , Alexei A. Vorontsov , Charlie Poole',
u'Copyright (c) 2000-2004 Philip A. Craig',
u'Copyright (c) 2007, 2008 LShift Ltd.',
u'Copyright (c) 2007, 2008 Cohesive Financial Technologies LLC.',
u'Copyright (c) 2007, 2008 Rabbit Technologies Ltd.',
u'Copyright (c) 2007, 2008 LShift Ltd., Cohesive Financial Technologies LLC.',
u'Copyright (c) 2007, 2008 LShift Ltd. , Cohesive Financial Technologies',
u'Copyright (c) 2007 LShift Ltd. , Cohesive Financial Technologies',
u'Copyright (c) ???? Simon Mourier <simonm@microsoft.com>',
]
check_detection(expected, test_file)
def test_copyright_debian_lib_3(self):
test_file = self.get_test_loc('copyrights/copyright_debian_lib_3-libmono_security_cil_copyright.copyright')
expected = [
u'Copyright 2004 The Apache Software Foundation',
u'Copyright (c) 2001-2005 Novell',
u'Copyright (c) Microsoft Corporation',
u'Copyright (c) 2007 James Newton-King',
u'Copyright (c) 2002-2004 James W. Newkirk , Michael C. Two , Alexei A. Vorontsov , Charlie Poole',
u'Copyright (c) 2000-2004 Philip A. Craig',
u'Portions Copyright (c) 2002-2004 James W. Newkirk , Michael C. Two , Alexei A. Vorontsov , Charlie Poole',
u'Copyright (c) 2000-2004 Philip A. Craig',
u'Copyright (c) 2007, 2008 LShift Ltd.',
u'Copyright (c) 2007, 2008 Cohesive Financial Technologies LLC.',
u'Copyright (c) 2007, 2008 Rabbit Technologies Ltd.',
u'Copyright (c) 2007, 2008 LShift Ltd. , Cohesive Financial Technologies',
u'Copyright (c) 2007, 2008 LShift Ltd. , Cohesive Financial Technologies',
u'Copyright (c) 2007 LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd.',
u'Copyright (c) ???? Simon Mourier <simonm@microsoft.com>',
]
check_detection(expected, test_file)
def test_copyright_debian_multi_names_on_one_line(self):
test_file = self.get_test_loc('copyrights/copyright_debian_multi_names_on_one_line-libgdata__copyright.copyright')
expected = [
u'Copyright 1999-2004 Ximian, Inc. 1999-2005 Novell, Inc.',
u'copyright 2000-2003 Ximian, Inc. , 2003 Gergo Erdi',
u'copyright 2000 Eskil Heyn Olsen , 2000 Ximian, Inc.',
u'copyright 1998 The Free Software Foundation , 2000 Ximian, Inc.',
u'copyright 1998-2005 The OpenLDAP Foundation',
u'Copyright 1999-2003 The OpenLDAP Foundation , Redwood City, California',
u'Copyright 1999-2000 Eric Busboom , The Software Studio (http://www.softwarestudio.org) 2001 Critical Path Authors',
u'(c) Copyright 1996 Apple Computer, Inc. , AT&T Corp., International Business Machines Corporation and Siemens Rolm Communications Inc.',
u'Copyright (c) 1997 Theo de Raadt',
u'copyright 2000 Andrea Campi',
u'copyright 2002 Andrea Campi',
u'copyright 2003 Andrea Campi',
u'Copyright 2002 Jonas Borgstrom <jonas@codefactory.se> 2002 Daniel Lundin <daniel@codefactory.se> 2002 CodeFactory AB',
u'copyright 1996 Apple Computer, Inc. , AT&T Corp. , International Business Machines Corporation and Siemens Rolm Communications Inc.',
u'copyright 1986-2000 Hiram Clawson',
u'copyright 1997 Theo de Raadt',
u'Copyright (c) 1996-2002 Sleepycat Software',
u'Copyright (c) 1990, 1993, 1994, 1995, 1996 Keith Bostic',
u'Copyright (c) 1990, 1993, 1994, 1995 The Regents of the University of California',
]
check_detection(expected, test_file,
expected_in_results=False,
results_in_expected=True)
def test_copyright_dionysos_c(self):
test_file = self.get_test_loc('copyrights/copyright_dionysos_c-c.c')
expected = [
u'COPYRIGHT (c) 2006 - 2009 DIONYSOS',
u'COPYRIGHT (c) ADIONYSOS 2006 - 2009',
u'COPYRIGHT (c) ADIONYSOS2 2006',
u'COPYRIGHT (c) MyCompany 2006 - 2009',
u'COPYRIGHT (c) 2006 MyCompany2',
u'copyright (c) 2006 - 2009 DIONYSOS',
u'copyright (c) ADIONYSOS 2006 - 2009',
u'copyright (c) ADIONYSOS2 2006',
u'copyright (c) MyCompany 2006 - 2009',
u'copyright (c) 2006 MyCompany2',
]
check_detection(expected, test_file)
def test_copyright_disclaimed(self):
test_file = self.get_test_loc('copyrights/copyright_disclaimed-c.c')
expected = [
u'Copyright disclaimed 2003 by Andrew Clarke',
]
check_detection(expected, test_file)
def test_copyright_djvulibre_desktop_copyright(self):
test_file = self.get_test_loc('copyrights/copyright_djvulibre_desktop_copyright-djvulibre_desktop_copyright.copyright')
expected = [
u'Copyright (c) 2002 Leon Bottou and Yann Le Cun',
u'Copyright (c) 2001 AT&T',
u'Copyright (c) 1999-2001 LizardTech, Inc.',
]
check_detection(expected, test_file)
def test_copyright_docbook_xsl_doc_html_copyright(self):
test_file = self.get_test_loc('copyrights/copyright_docbook_xsl_doc_html_copyright-docbook_xsl_doc_html_copyright.copyright')
expected = [
u'Copyright (c) 1999-2007 Norman Walsh',
u'Copyright (c) 2003 Jiri Kosek',
u'Copyright (c) 2004-2007 Steve Ball',
u'Copyright (c) 2005-2008 The DocBook Project',
]
check_detection(expected, test_file)
def test_copyright_drand48_c(self):
test_file = self.get_test_loc('copyrights/copyright_drand48_c-drand_c.c')
expected = [
u'Copyright (c) 1993 Martin Birgmeier',
]
check_detection(expected, test_file)
def test_copyright_ed_copyright(self):
test_file = self.get_test_loc('copyrights/copyright_ed_copyright-ed_copyright.copyright')
expected = [
u'Copyright (c) 1993, 1994 Andrew Moore , Talke Studio',
u'Copyright (c) 2006, 2007 Antonio Diaz Diaz',
u'Copyright (c) 1997-2007 James Troup',
u'Copyright (c) 1993, 2006, 2007 Free Software Foundation, Inc.',
]
check_detection(expected, test_file)
def test_copyright_epiphany_browser_data_copyright_label(self):
test_file = self.get_test_loc('copyrights/copyright_epiphany_browser_data_copyright_label-epiphany_browser_data_copyright_label.label')
expected = [
u'Copyright (c) 2004 the Initial Developer.',
u'(c) 2003-2007, the Debian GNOME team <pkg-gnome-maintainers@lists.alioth.debian.org>',
]
check_detection(expected, test_file)
def test_copyright_eric_young_c(self):
test_file = self.get_test_loc('copyrights/copyright_eric_young_c-c.c')
expected = [
u'Copyright (c) 1995-1997 Eric Young (eay@mincom.oz.au)',
]
check_detection(expected, test_file)
def test_copyright_errno_atheros(self):
test_file = self.get_test_loc('copyrights/copyright_errno_atheros-c.c')
expected = [
'Copyright (c) 2002-2006 Sam Leffler, Errno Consulting, Atheros Communications, Inc.',
]
check_detection(expected, test_file)
def test_copyright_errno_atheros_ah_h(self):
test_file = self.get_test_loc('copyrights/copyright_errno_atheros_ah_h-ah_h.h')
expected = [
u'Copyright (c) 2002-2006 Sam Leffler, Errno Consulting, Atheros Communications, Inc.',
]
check_detection(expected, test_file)
def test_copyright_errno_c(self):
test_file = self.get_test_loc('copyrights/copyright_errno_c-c.c')
expected = [
u'Copyright (c) 2002-2006 Sam Leffler, Errno Consulting, Atheros Communications, Inc.',
]
check_detection(expected, test_file)
def test_copyright_esmertec_java(self):
test_file = self.get_test_loc('copyrights/copyright_esmertec_java-java.java')
expected = [
u'Copyright (c) 2008 Esmertec AG',
u'Copyright (c) 2008 The Android Open Source Project',
]
check_detection(expected, test_file)
def test_copyright_essential_smoke(self):
test_file = self.get_test_loc('copyrights/copyright_essential_smoke-ibm_c.c')
expected = [
u'Copyright IBM and others (c) 2008',
u'Copyright Eclipse, IBM and others (c) 2008',
]
check_detection(expected, test_file)
def test_copyright_expat_h(self):
test_file = self.get_test_loc('copyrights/copyright_expat_h-expat_h.h')
expected = [
u'Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd',
]
check_detection(expected, test_file)
def test_copyright_ext_all_js(self):
test_file = self.get_test_loc('copyrights/copyright_ext_all_js-ext_all_js.js')
expected = [
u'Copyright (c) 2006-2009 Ext JS, LLC',
]
check_detection(expected, test_file)
def test_copyright_extjs_c(self):
test_file = self.get_test_loc('copyrights/copyright_extjs_c-c.c')
expected = [
u'Copyright (c) 2006-2007, Ext JS, LLC.',
]
check_detection(expected, test_file)
def test_copyright_fsf_py(self):
test_file = self.get_test_loc('copyrights/copyright_fsf_py-999_py.py')
expected = [
u'Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.',
]
check_detection(expected, test_file)
def test_copyright_gailly(self):
test_file = self.get_test_loc('copyrights/copyright_gailly-c.c')
expected = [
u'Copyright (c) 1992-1993 Jean-loup Gailly.',
u'Copyright (c) 1992-1993 Jean-loup Gailly',
u'Copyright (c) 1992-1993 Jean-loup Gailly',
]
check_detection(expected, test_file)
def test_copyright_geoff_js(self):
test_file = self.get_test_loc('copyrights/copyright_geoff_js-js.js')
expected = [
u'Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis',
]
check_detection(expected, test_file)
def test_copyright_gnome_session_copyright(self):
test_file = self.get_test_loc('copyrights/copyright_gnome_session_copyright-gnome_session_copyright.copyright')
expected = [
u'Copyright (c) 1999-2009 Red Hat, Inc.',
u'Copyright (c) 1999-2007 Novell, Inc.',
u'Copyright (c) 2001-2003 George Lebl',
u'Copyright (c) 2001 Queen of England',
u'Copyright (c) 2007-2008 William Jon McCann',
u'Copyright (c) 2006 Ray Strode',
u'Copyright (c) 2008 Lucas Rocha',
u'Copyright (c) 2005 Raffaele Sandrini',
u'Copyright (c) 2006-2007 Vincent Untz',
u'Copyright (c) 1998 Tom Tromey',
u'Copyright (c) 1999 Free Software Foundation, Inc.',
u'Copyright (c) 2003 Sun Microsystems, Inc.',
]
check_detection(expected, test_file)
def test_copyright_gnome_system_monitor_copyright(self):
test_file = self.get_test_loc('copyrights/copyright_gnome_system_monitor_copyright-gnome_system_monitor_copyright.copyright')
expected = [
u'Copyright Holders: Kevin Vandersloot <kfv101@psu.edu> Erik Johnsson <zaphod@linux.nu>',
]
check_detection(expected, test_file,
expected_in_results=False,
results_in_expected=True)
def test_copyright_gnome_system_monitor_copyright_label(self):
test_file = self.get_test_loc('copyrights/copyright_gnome_system_monitor_copyright_label-gnome_system_monitor_copyright_label.label')
expected = [
u'Copyright Holders: Kevin Vandersloot <kfv101@psu.edu> Erik Johnsson <zaphod@linux.nu>',
]
check_detection(expected, test_file,
expected_in_results=False,
results_in_expected=True)
def test_copyright_gobjc_4_3_copyright(self):
test_file = self.get_test_loc('copyrights/copyright_gobjc_4_3_copyright-gobjc__copyright.copyright')
expected = [
u'Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.',
u'copyright Free Software Foundation',
u'Copyright (c) 2004-2005 by Digital Mars , www.digitalmars.com',
u'Copyright (c) 1996-2003 Red Hat, Inc.',
]
check_detection(expected, test_file)
def test_copyright_google_closure_templates_java_html(self):
test_file = self.get_test_loc('copyrights/copyright_google_closure_templates_java_html-html.html')
expected = [
u'(c) 2009 Google',
]
check_detection(expected, test_file)
def test_copyright_google_view_layout1_xml(self):
test_file = self.get_test_loc('copyrights/copyright_google_view_layout1_xml-view_layout_xml.xml')
expected = [
u'Copyright (c) 2008 Google Inc.',
]
check_detection(expected, test_file)
def test_copyright_group(self):
test_file = self.get_test_loc('copyrights/copyright_group-c.c')
expected = [
u'Copyright (c) 2014 ARRis Group, Inc.',
u'Copyright (c) 2013 ARRIS Group, Inc.',
]
check_detection(expected, test_file)
def test_copyright_gsoap(self):
test_file = self.get_test_loc('copyrights/copyright_gsoap-gSOAP')
expected = [
u'Copyright (c) 2001-2004 Robert A. van Engelen, Genivia inc.',
u'Copyright (c) 2001-2004 Robert A. van Engelen, Genivia inc.',
]
check_detection(expected, test_file)
def test_copyright_gstreamer0_fluendo_mp3_copyright(self):
test_file = self.get_test_loc('copyrights/copyright_gstreamer0_fluendo_mp3_copyright-gstreamer__fluendo_mp_copyright.copyright')
expected = [
u'Copyright (c) 2005,2006 Fluendo',
u'Copyright 2005 Fluendo',
]
check_detection(expected, test_file)
def test_copyright_hall(self):
test_file = self.get_test_loc('copyrights/copyright_hall-copyright.txt')
expected = [
u'Copyright (c) 2004, Richard S. Hall',
u'Copyright (c) 2004, Didier Donsez',
u'Copyright (c) 2002,2003, Stefan Haustein, Oberhausen',
]
check_detection(expected, test_file)
def test_copyright_hans_jurgen_htm(self):
test_file = self.get_test_loc('copyrights/copyright_hans_jurgen_htm-9_html.html')
expected = [
u'Copyright (c) 2006 by Hans-Jurgen Koch.',
]
check_detection(expected, test_file,
expected_in_results=True,