2323
2424def test_search_copyright_information_incorrect_typo ():
2525 """Test searching for copyright information with a typo in the copyright information."""
26- copyrights , remaining_block = search_copyright_information (
26+ copyrights , years_span , name_span , remaining_block = search_copyright_information (
2727 'CopyrightTypo 2020 Open Source Robotics Foundation, Inc.'
2828 )
2929 assert len (copyrights ) == 0
30+ assert years_span == []
31+ assert name_span == []
32+ assert len (remaining_block ) == 56
3033
3134
3235def test_search_copyright_information_repeated ():
3336 """Test searching with repeated 'copyright' in the copyright information."""
34- copyrights , remaining_block = search_copyright_information (
37+ copyrights , years_span , name_span , remaining_block = search_copyright_information (
3538 '\\ copyright Copyright 2020 Open Source Robotics Foundation, Inc.'
3639 )
3740 assert len (copyrights ) == 1
41+ assert years_span == [(21 , 25 )]
42+ assert name_span == [(26 , 63 )]
43+ assert len (remaining_block ) == 0
3844
3945
4046def test_search_copyright_information_multiple_holders ():
4147 """Test searching multiple holders."""
42- copyrights , remaining_block = search_copyright_information (
48+ copyrights , years_span , name_span , remaining_block = search_copyright_information (
4349 """Copyright 2020 Open Source Robotics Foundation, Inc.
4450 Copyright (c) 2009, Willow Garage, Inc."""
4551 )
4652 assert len (copyrights ) == 2
53+ assert years_span == [(10 , 14 ), (26 , 30 )]
54+ assert name_span == [(15 , 52 ), (32 , 51 )]
55+ assert len (remaining_block ) == 0
4756
4857
4958def test_search_copyright_information_capitalization1 ():
@@ -53,10 +62,13 @@ def test_search_copyright_information_capitalization1():
5362 Word 'copyright': capitalized
5463 Abbreviation '(c)': absent
5564 """
56- copyrights , remaining_block = search_copyright_information (
65+ copyrights , years_span , name_span , remaining_block = search_copyright_information (
5766 ' Copyright 2020 Open Source Robotics Foundation, Inc.' )
58- assert copyrights [0 ].name == 'Open Source Robotics Foundation, Inc.'
5967 assert len (copyrights ) == 1
68+ assert copyrights [0 ].name == 'Open Source Robotics Foundation, Inc.'
69+ assert years_span == [(12 , 16 )]
70+ assert name_span == [(17 , 54 )]
71+ assert len (remaining_block ) == 0
6072
6173
6274def test_search_copyright_information_capitalization2 ():
@@ -66,9 +78,12 @@ def test_search_copyright_information_capitalization2():
6678 Word 'copyright': capitalized
6779 Abbreviation '(c)': lowercase
6880 """
69- copyrights , remaining_block = search_copyright_information (
81+ copyrights , years_span , name_span , remaining_block = search_copyright_information (
7082 'Copyright (c) 2020 Open Source Robotics Foundation, Inc.' )
7183 assert len (copyrights ) == 1
84+ assert years_span == [(14 , 18 )]
85+ assert name_span == [(19 , 56 )]
86+ assert len (remaining_block ) == 0
7287
7388
7489def test_search_copyright_information_capitalization3 ():
@@ -78,9 +93,12 @@ def test_search_copyright_information_capitalization3():
7893 Word 'copyright': capitalized
7994 Abbreviation '(c)': uppercase
8095 """
81- copyrights , remaining_block = search_copyright_information (
96+ copyrights , years_span , name_span , remaining_block = search_copyright_information (
8297 'Copyright (C) 2020 Open Source Robotics Foundation, Inc.' )
8398 assert len (copyrights ) == 1
99+ assert years_span == [(14 , 18 )]
100+ assert name_span == [(19 , 56 )]
101+ assert len (remaining_block ) == 0
84102
85103
86104def test_search_copyright_information_lowercase1 ():
@@ -90,9 +108,12 @@ def test_search_copyright_information_lowercase1():
90108 Word 'copyright': lowercase
91109 Abbreviation '(c)': absent
92110 """
93- copyrights , remaining_block = search_copyright_information (
111+ copyrights , years_span , name_span , remaining_block = search_copyright_information (
94112 'copyright 2020 Open Source Robotics Foundation, Inc.' )
95113 assert len (copyrights ) == 1
114+ assert years_span == [(10 , 14 )]
115+ assert name_span == [(15 , 52 )]
116+ assert len (remaining_block ) == 0
96117
97118
98119def test_search_copyright_information_lowercase2 ():
@@ -102,9 +123,12 @@ def test_search_copyright_information_lowercase2():
102123 Word 'copyright': lowercase
103124 Abbreviation '(c)': lowercase
104125 """
105- copyrights , remaining_block = search_copyright_information (
126+ copyrights , years_span , name_span , remaining_block = search_copyright_information (
106127 'copyright (c) 2020 Open Source Robotics Foundation, Inc.' )
107128 assert len (copyrights ) == 1
129+ assert years_span == [(14 , 18 )]
130+ assert name_span == [(19 , 56 )]
131+ assert len (remaining_block ) == 0
108132
109133
110134def test_search_copyright_information_uppercase1 ():
@@ -114,9 +138,12 @@ def test_search_copyright_information_uppercase1():
114138 Word 'copyright': uppercase
115139 Abbreviation '(c)': absent
116140 """
117- copyrights , remaining_block = search_copyright_information (
141+ copyrights , years_span , name_span , remaining_block = search_copyright_information (
118142 'COPYRIGHT 2020 Open Source Robotics Foundation, Inc.' )
119143 assert len (copyrights ) == 1
144+ assert years_span == [(10 , 14 )]
145+ assert name_span == [(15 , 52 )]
146+ assert len (remaining_block ) == 0
120147
121148
122149def test_search_copyright_information_uppercase2 ():
@@ -126,9 +153,12 @@ def test_search_copyright_information_uppercase2():
126153 Word 'copyright': uppercase
127154 Abbreviation '(c)': uppercase
128155 """
129- copyrights , remaining_block = search_copyright_information (
156+ copyrights , years_span , name_span , remaining_block = search_copyright_information (
130157 'COPYRIGHT (C) 2020 Open Source Robotics Foundation, Inc.' )
131158 assert len (copyrights ) == 1
159+ assert years_span == [(14 , 18 )]
160+ assert name_span == [(19 , 56 )]
161+ assert len (remaining_block ) == 0
132162
133163
134164def test_split_template_no_split ():
0 commit comments