From 15a09da96d7e622de6b0571fac171fc2253c8a8f Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Fri, 7 Jan 2011 01:44:19 +0000 Subject: [PATCH] Added license to unit tests As the test suite is now part of the source distribution. --- tests/__init__.py | 22 ++++++++++++++++++++++ tests/bugX000.py | 22 ++++++++++++++++++++++ tests/bug_gc.py | 22 ++++++++++++++++++++++ tests/test_async.py | 24 ++++++++++++++++++++++++ tests/test_cancel.py | 23 +++++++++++++++++++++++ tests/test_connection.py | 22 ++++++++++++++++++++++ tests/test_copy.py | 23 +++++++++++++++++++++++ tests/test_cursor.py | 22 ++++++++++++++++++++++ tests/test_dates.py | 22 ++++++++++++++++++++++ tests/test_green.py | 22 ++++++++++++++++++++++ tests/test_lobject.py | 23 +++++++++++++++++++++++ tests/test_notify.py | 23 +++++++++++++++++++++++ tests/test_psycopg2_dbapi20.py | 23 +++++++++++++++++++++++ tests/test_quote.py | 23 +++++++++++++++++++++++ tests/test_transaction.py | 23 +++++++++++++++++++++++ tests/testutils.py | 25 ++++++++++++++++++++++--- 16 files changed, 361 insertions(+), 3 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 205b8443..7a7d9c43 100755 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,27 @@ #!/usr/bin/env python +# psycopg2 test suite +# +# Copyright (C) 2007-2011 Federico Di Gregorio +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + import os import sys from testutils import unittest diff --git a/tests/bugX000.py b/tests/bugX000.py index e3e9a998..efa593ec 100755 --- a/tests/bugX000.py +++ b/tests/bugX000.py @@ -1,5 +1,27 @@ #!/usr/bin/env python +# bugX000.py - test for DateTime object allocation bug +# +# Copyright (C) 2007-2011 Federico Di Gregorio +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + import psycopg2 import time import unittest diff --git a/tests/bug_gc.py b/tests/bug_gc.py index 89d90d26..71dac1c8 100755 --- a/tests/bug_gc.py +++ b/tests/bug_gc.py @@ -1,5 +1,27 @@ #!/usr/bin/env python +# bug_gc.py - test for refcounting/GC bug +# +# Copyright (C) 2010-2011 Federico Di Gregorio +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + import psycopg2 import psycopg2.extensions import time diff --git a/tests/test_async.py b/tests/test_async.py index d4854fc5..9a388ec6 100755 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -1,4 +1,28 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- + +# test_async.py - unit test for asynchronous API +# +# Copyright (C) 2010-2011 Jan Urbański +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + from testutils import unittest, skip_if_no_pg_sleep import psycopg2 diff --git a/tests/test_cancel.py b/tests/test_cancel.py index 94daec14..dac2b256 100755 --- a/tests/test_cancel.py +++ b/tests/test_cancel.py @@ -1,4 +1,27 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- + +# test_cancel.py - unit test for query cancellation +# +# Copyright (C) 2010-2011 Jan Urbański +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. import time import threading diff --git a/tests/test_connection.py b/tests/test_connection.py index 396254f2..f1821903 100755 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1,5 +1,27 @@ #!/usr/bin/env python +# test_connection.py - unit test for connection attributes +# +# Copyright (C) 2008-2011 James Henstridge +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + import time import threading from testutils import unittest, decorate_all_tests, skip_if_no_pg_sleep diff --git a/tests/test_copy.py b/tests/test_copy.py index b0d9965c..c51ef098 100755 --- a/tests/test_copy.py +++ b/tests/test_copy.py @@ -1,4 +1,27 @@ #!/usr/bin/env python + +# test_copy.py - unit test for COPY support +# +# Copyright (C) 2010-2011 Daniele Varrazzo +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + import os import string from testutils import unittest, decorate_all_tests diff --git a/tests/test_cursor.py b/tests/test_cursor.py index e5dd39b9..dec0cd14 100755 --- a/tests/test_cursor.py +++ b/tests/test_cursor.py @@ -1,5 +1,27 @@ #!/usr/bin/env python +# test_cursor.py - unit test for cursor attributes +# +# Copyright (C) 2010-2011 Daniele Varrazzo +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + import unittest import psycopg2 import psycopg2.extensions diff --git a/tests/test_dates.py b/tests/test_dates.py index 5c468337..d393c4f9 100755 --- a/tests/test_dates.py +++ b/tests/test_dates.py @@ -1,5 +1,27 @@ #!/usr/bin/env python +# test_dates.py - unit test for dates handling +# +# Copyright (C) 2008-2011 James Henstridge +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + import math import unittest import tests diff --git a/tests/test_green.py b/tests/test_green.py index 04fbc1ae..f0b1c37e 100755 --- a/tests/test_green.py +++ b/tests/test_green.py @@ -1,5 +1,27 @@ #!/usr/bin/env python +# test_green.py - unit test for async wait callback +# +# Copyright (C) 2010-2011 Daniele Varrazzo +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + import unittest import psycopg2 import psycopg2.extensions diff --git a/tests/test_lobject.py b/tests/test_lobject.py index 88e18d6f..056496ec 100755 --- a/tests/test_lobject.py +++ b/tests/test_lobject.py @@ -1,4 +1,27 @@ #!/usr/bin/env python + +# test_lobject.py - unit test for large objects support +# +# Copyright (C) 2008-2011 James Henstridge +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + import os import shutil import tempfile diff --git a/tests/test_notify.py b/tests/test_notify.py index bc14f374..23ca1761 100755 --- a/tests/test_notify.py +++ b/tests/test_notify.py @@ -1,4 +1,27 @@ #!/usr/bin/env python + +# test_notify.py - unit test for async notifications +# +# Copyright (C) 2010-2011 Daniele Varrazzo +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + from testutils import unittest import psycopg2 diff --git a/tests/test_psycopg2_dbapi20.py b/tests/test_psycopg2_dbapi20.py index 93fdfa60..5eec97a2 100755 --- a/tests/test_psycopg2_dbapi20.py +++ b/tests/test_psycopg2_dbapi20.py @@ -1,4 +1,27 @@ #!/usr/bin/env python + +# test_psycopg2_dbapi20.py - DB API conformance test for psycopg2 +# +# Copyright (C) 2006-2011 Federico Di Gregorio +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + import dbapi20 import dbapi20_tpc from test_connection import skip_if_tpc_disabled diff --git a/tests/test_quote.py b/tests/test_quote.py index 7ea6c307..7363a3dd 100755 --- a/tests/test_quote.py +++ b/tests/test_quote.py @@ -1,4 +1,27 @@ #!/usr/bin/env python + +# test_quote.py - unit test for strings quoting +# +# Copyright (C) 2007-2011 Daniele Varrazzo +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + from testutils import unittest import psycopg2 diff --git a/tests/test_transaction.py b/tests/test_transaction.py index 5bbed38f..0074215b 100755 --- a/tests/test_transaction.py +++ b/tests/test_transaction.py @@ -1,4 +1,27 @@ #!/usr/bin/env python + +# test_transaction - unit test on transaction behaviour +# +# Copyright (C) 2007-2011 Federico Di Gregorio +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + import threading from testutils import unittest, skip_if_no_pg_sleep diff --git a/tests/testutils.py b/tests/testutils.py index b7c0faba..6d04fc02 100644 --- a/tests/testutils.py +++ b/tests/testutils.py @@ -1,6 +1,25 @@ -# Utility module for psycopg2 testing. -# -# Copyright (C) 2010 Daniele Varrazzo +# testutils.py - utility module for psycopg2 testing. +# +# Copyright (C) 2010-2011 Daniele Varrazzo +# +# psycopg2 is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# In addition, as a special exception, the copyright holders give +# permission to link this program with the OpenSSL library (or with +# modified versions of OpenSSL that use the same license as OpenSSL), +# and distribute linked combinations including the two. +# +# You must obey the GNU Lesser General Public License in all respects for +# all of the code used other than OpenSSL. +# +# psycopg2 is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +# License for more details. + # Use unittest2 if available. Otherwise mock a skip facility with warnings.