def test_detect(self):
     location = self.get_test_loc('copyrights_basic/essential_smoke-ibm_c.c')
     expected = [
         'Copyright IBM and others (c) 2008',
         'Copyright Eclipse, IBM and others',
         '(c) 2008',
     ]
     copyrights, _, _ = cluecode_test_utils.copyright_detector(location)
     assert copyrights == expected
Esempio n. 2
0
    def copyright_test_method(self):
        copyrights, _authors, _holders = cluecode_test_utils.copyright_detector(test_file_loc)

        try:
            assert copyrights == expected
        except:
            failure_trace = [
                'Failed to detect copyright in: file://' + test_file_loc, '\n',
                'expected as file://' + expected_file_loc, '\n',
                ] + expected

            assert copyrights == failure_trace
    def copyright_test_method(self):
        copyrights, _authors, _holders = cluecode_test_utils.copyright_detector(
            test_file_loc)
        copyrights = [c.encode('utf-8') for c in copyrights]

        try:
            assert expected == copyrights
        except:
            failure_trace = [
                'Failed to detect copyright in: file://' + test_file_loc,
                '\n',
                'expected as file://' + expected_file_loc,
                '\n',
            ] + expected

            assert failure_trace == copyrights