From fad0228aa8faf2634f8b352b5736fff3d6a3f4c2 Mon Sep 17 00:00:00 2001 From: swastkk Date: Tue, 2 Apr 2024 14:17:46 +0530 Subject: [PATCH 1/2] Add unit test for [C] copyright sign Signed-off-by: swastkk --- tests/cluecode/test_copyrights_basic.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/cluecode/test_copyrights_basic.py b/tests/cluecode/test_copyrights_basic.py index 0ad2c025fc2..e72503bcda3 100644 --- a/tests/cluecode/test_copyrights_basic.py +++ b/tests/cluecode/test_copyrights_basic.py @@ -31,6 +31,17 @@ def test_prepare_text_line(self): result = copyrights.prepare_text_line(cp) assert result == 'test (c) all rights reserved' + def test_invaild_copyright(self): + cp= '[C] The Regents of the University of Michigan' + result= copyrights.prepare_text_line(cp) + assert result == 'Copyright (C) The Regents of the University of Michigan' + + def test_invaild_copyright_insensitivity(self): + cp= '[c] The Regents of the University of Michigan and Merit Network, Inc. 1992,' + result= copyrights.prepare_text_line(cp) + print(result) + assert result== '(c) The Regents of the University of Michigan and Merit Network, Inc. 1992,' + def test_prepare_text_line_debian(self): cp = 'Parts Copyright (c) 1992 Uri Blumenthal, IBM' result = copyrights.prepare_text_line(cp) From 94bf6a6906307115e6d56d692a30bea65c9a5181 Mon Sep 17 00:00:00 2001 From: swastkk Date: Mon, 17 Jun 2024 22:30:54 +0530 Subject: [PATCH 2/2] Fix minor nits Signed-off-by: swastkk --- tests/cluecode/test_copyrights_basic.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/cluecode/test_copyrights_basic.py b/tests/cluecode/test_copyrights_basic.py index e72503bcda3..7722eaa92e6 100644 --- a/tests/cluecode/test_copyrights_basic.py +++ b/tests/cluecode/test_copyrights_basic.py @@ -32,15 +32,14 @@ def test_prepare_text_line(self): assert result == 'test (c) all rights reserved' def test_invaild_copyright(self): - cp= '[C] The Regents of the University of Michigan' - result= copyrights.prepare_text_line(cp) + cp = '[C] The Regents of the University of Michigan' + result = copyrights.prepare_text_line(cp) assert result == 'Copyright (C) The Regents of the University of Michigan' def test_invaild_copyright_insensitivity(self): - cp= '[c] The Regents of the University of Michigan and Merit Network, Inc. 1992,' - result= copyrights.prepare_text_line(cp) - print(result) - assert result== '(c) The Regents of the University of Michigan and Merit Network, Inc. 1992,' + cp = '[c] The Regents of the University of Michigan and Merit Network, Inc. 1992,' + result = copyrights.prepare_text_line(cp) + assert result == '(c) The Regents of the University of Michigan and Merit Network, Inc. 1992,' def test_prepare_text_line_debian(self): cp = 'Parts Copyright (c) 1992 Uri Blumenthal, IBM'