You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by ju...@apache.org on 2013/02/07 15:50:28 UTC

svn commit: r1443514 - in /incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests: db/ db/__init__.py db/api.py db/cursor.py db/mysql.py db/postgres.py db/util.py dbcursor.py

Author: jure
Date: Thu Feb  7 14:50:28 2013
New Revision: 1443514

URL: http://svn.apache.org/viewvc?rev=1443514&view=rev
Log:
#288, run trac.db.tests within product environment, skeleton(s) for further tests (mysql, postgres)


Added:
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/__init__.py
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/api.py
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/cursor.py
      - copied unchanged from r1442598, incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/dbcursor.py
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/mysql.py
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/postgres.py
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/util.py
Removed:
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/dbcursor.py

Added: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/__init__.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/__init__.py?rev=1443514&view=auto
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/__init__.py (added)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/__init__.py Thu Feb  7 14:50:28 2013
@@ -0,0 +1,18 @@
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+

Added: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/api.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/api.py?rev=1443514&view=auto
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/api.py (added)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/api.py Thu Feb  7 14:50:28 2013
@@ -0,0 +1,51 @@
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+import unittest
+
+from trac.db.tests.api import ParseConnectionStringTestCase, StringsTestCase, ConnectionTestCase, WithTransactionTest
+
+from tests.db.util import ProductEnvMixin
+
+class ProductParseConnectionStringTestCase(ParseConnectionStringTestCase, ProductEnvMixin):
+    pass
+
+class ProductStringsTestCase(StringsTestCase, ProductEnvMixin):
+    pass
+
+class ProductConnectionTestCase(ConnectionTestCase, ProductEnvMixin):
+    pass
+
+class ProductWithTransactionTestCase(WithTransactionTest, ProductEnvMixin):
+    pass
+
+def suite():
+    suite = unittest.TestSuite([
+        unittest.makeSuite(ParseConnectionStringTestCase, 'test'),
+        unittest.makeSuite(StringsTestCase, 'test'),
+        unittest.makeSuite(ConnectionTestCase, 'test'),
+        unittest.makeSuite(WithTransactionTest, 'test'),
+        unittest.makeSuite(ProductParseConnectionStringTestCase, 'test'),
+        unittest.makeSuite(ProductStringsTestCase, 'test'),
+        unittest.makeSuite(ProductConnectionTestCase, 'test'),
+        unittest.makeSuite(ProductWithTransactionTestCase, 'test'),
+    ])
+    return suite
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='suite')

Added: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/mysql.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/mysql.py?rev=1443514&view=auto
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/mysql.py (added)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/mysql.py Thu Feb  7 14:50:28 2013
@@ -0,0 +1,36 @@
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+import unittest
+
+from trac.db.tests.mysql_test import MySQLTableAlterationSQLTest
+
+from tests.db.util import ProductEnvMixin
+
+class ProductMySQLTableAlterationSQLTest(MySQLTableAlterationSQLTest, ProductEnvMixin):
+    pass
+
+def suite():
+    suite = unittest.TestSuite([
+        unittest.makeSuite(MySQLTableAlterationSQLTest, 'test'),
+        unittest.makeSuite(ProductMySQLTableAlterationSQLTest, 'test'),
+    ])
+    return suite
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='suite')

Added: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/postgres.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/postgres.py?rev=1443514&view=auto
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/postgres.py (added)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/postgres.py Thu Feb  7 14:50:28 2013
@@ -0,0 +1,41 @@
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+import unittest
+
+from trac.db.tests.postgres_test import PostgresTableCreationSQLTest, PostgresTableAlterationSQLTest
+
+from tests.db.util import ProductEnvMixin
+
+class ProductPostgresTableCreationSQLTest(PostgresTableCreationSQLTest, ProductEnvMixin):
+    pass
+
+class ProductPostgresTableAlterationSQLTest(PostgresTableAlterationSQLTest, ProductEnvMixin):
+    pass
+
+def suite():
+    suite = unittest.TestSuite([
+      unittest.makeSuite(PostgresTableCreationSQLTest, 'test'),
+      unittest.makeSuite(PostgresTableAlterationSQLTest, 'test'),
+      unittest.makeSuite(ProductPostgresTableCreationSQLTest, 'test'),
+      unittest.makeSuite(ProductPostgresTableAlterationSQLTest, 'test'),
+    ])
+    return suite
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='suite')

Added: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/util.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/util.py?rev=1443514&view=auto
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/util.py (added)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/db/util.py Thu Feb  7 14:50:28 2013
@@ -0,0 +1,26 @@
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+from multiproduct.env import ProductEnvironment
+from tests.env import MultiproductTestCase
+
+class ProductEnvMixin(MultiproductTestCase):
+    def setUp(self):
+        self._mp_setup()
+        self.global_env = self.env
+        self.env = ProductEnvironment(self.global_env, self.default_product)