"Fossies" - the Fresh Open Source Software Archive

Member "roundup-2.0.0/test/test_sqlite.py" (26 Aug 2019, 2217 Bytes) of package /linux/www/roundup-2.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test_sqlite.py": 1.6.1_vs_2.0.0.

    1 #
    2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
    3 # This module is free software, and you may redistribute it and/or modify
    4 # under the same terms as Python, so long as this copyright message and
    5 # disclaimer are retained in their original form.
    6 #
    7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
    8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
    9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
   10 # POSSIBILITY OF SUCH DAMAGE.
   11 #
   12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
   13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
   14 # FOR A PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
   15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
   16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   17 
   18 import unittest, os, shutil, time
   19 from roundup.backends import get_backend, have_backend
   20 
   21 from .db_test_base import DBTest, ROTest, SchemaTest, ClassicInitTest, config
   22 from .db_test_base import ConcurrentDBTest, FilterCacheTest
   23 from .db_test_base import SpecialActionTest
   24 from .rest_common  import TestCase as RestTestCase
   25 
   26 class sqliteOpener:
   27     if have_backend('sqlite'):
   28         module = get_backend('sqlite')
   29 
   30     def nuke_database(self):
   31         shutil.rmtree(config.DATABASE)
   32 
   33 
   34 class sqliteDBTest(sqliteOpener, DBTest, unittest.TestCase):
   35     pass
   36 
   37 
   38 class sqliteROTest(sqliteOpener, ROTest, unittest.TestCase):
   39     pass
   40 
   41 
   42 class sqliteSchemaTest(sqliteOpener, SchemaTest, unittest.TestCase):
   43     pass
   44 
   45 
   46 class sqliteClassicInitTest(ClassicInitTest, unittest.TestCase):
   47     backend = 'sqlite'
   48 
   49 
   50 class sqliteConcurrencyTest(ConcurrentDBTest, unittest.TestCase):
   51     backend = 'sqlite'
   52 
   53 
   54 class sqliteFilterCacheTest(sqliteOpener, FilterCacheTest, unittest.TestCase):
   55     backend = 'sqlite'
   56 
   57 class sqliteSpecialActionTestCase(sqliteOpener, SpecialActionTest,
   58                                   unittest.TestCase):
   59     backend = 'sqlite'
   60 
   61 
   62 from .session_common import SessionTest
   63 class sqliteSessionTest(sqliteOpener, SessionTest, unittest.TestCase):
   64     pass
   65 
   66 class sqliteRestTest (RestTestCase, unittest.TestCase):
   67     backend = 'sqlite'