summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-01-07 01:44:19 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-01-09 23:44:35 +0000
commit15a09da96d7e622de6b0571fac171fc2253c8a8f (patch)
tree2575eb538549455cfb3300368c235991436fe8e8 /tests
parent7c1b03bd459b0b3db441bd2984fe3a68e5357efb (diff)
downloadpsycopg2-15a09da96d7e622de6b0571fac171fc2253c8a8f.tar.gz
Added license to unit tests
As the test suite is now part of the source distribution.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/__init__.py22
-rwxr-xr-xtests/bugX000.py22
-rwxr-xr-xtests/bug_gc.py22
-rwxr-xr-xtests/test_async.py24
-rwxr-xr-xtests/test_cancel.py23
-rwxr-xr-xtests/test_connection.py22
-rwxr-xr-xtests/test_copy.py23
-rwxr-xr-xtests/test_cursor.py22
-rwxr-xr-xtests/test_dates.py22
-rwxr-xr-xtests/test_green.py22
-rwxr-xr-xtests/test_lobject.py23
-rwxr-xr-xtests/test_notify.py23
-rwxr-xr-xtests/test_psycopg2_dbapi20.py23
-rwxr-xr-xtests/test_quote.py23
-rwxr-xr-xtests/test_transaction.py23
-rw-r--r--tests/testutils.py25
16 files changed, 361 insertions, 3 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
index 205b844..7a7d9c4 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 <fog@debian.org>
+#
+# 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 e3e9a99..efa593e 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 <fog@debian.org>
+#
+# 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 89d90d2..71dac1c 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 <fog@debian.org>
+#
+# 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 d4854fc..9a388ec 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 <wulczer@wulczer.org>
+#
+# 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 94daec1..dac2b25 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 <wulczer@wulczer.org>
+#
+# 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 396254f..f182190 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 <james@jamesh.id.au>
+#
+# 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 b0d9965..c51ef09 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 <daniele.varrazzo@gmail.com>
+#
+# 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 e5dd39b..dec0cd1 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 <daniele.varrazzo@gmail.com>
+#
+# 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 5c46833..d393c4f 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 <james@jamesh.id.au>
+#
+# 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 04fbc1a..f0b1c37 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 <daniele.varrazzo@gmail.com>
+#
+# 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 88e18d6..056496e 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 <james@jamesh.id.au>
+#
+# 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 bc14f37..23ca176 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 <daniele.varrazzo@gmail.com>
+#
+# 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 93fdfa6..5eec97a 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 <fog@debian.org>
+#
+# 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 7ea6c30..7363a3d 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 <daniele.varrazzo@gmail.com>
+#
+# 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 5bbed38..0074215 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 <fog@debian.org>
+#
+# 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 b7c0fab..6d04fc0 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -1,6 +1,25 @@
-# Utility module for psycopg2 testing.
-#
-# Copyright (C) 2010 Daniele Varrazzo <daniele.varrazzo@gmail.com>
+# testutils.py - utility module for psycopg2 testing.
+#
+# Copyright (C) 2010-2011 Daniele Varrazzo <daniele.varrazzo@gmail.com>
+#
+# 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.