!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing/suite/   drwxr-xr-x
Free 221.36 GB of 981.82 GB (22.55%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test_sequence.py (3.74 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
from .. import fixtures, config
from ..config import requirements
from ..assertions import eq_
from ... import testing

from ... import Integer, String, Sequence, schema

from ..schema import Table, Column


class SequenceTest(fixtures.TablesTest):
    __requires__ = ('sequences',)
    __backend__ = True

    run_create_tables = 'each'

    @classmethod
    def define_tables(cls, metadata):
        Table('seq_pk', metadata,
              Column('id', Integer, Sequence('tab_id_seq'), primary_key=True),
              Column('data', String(50))
              )

        Table('seq_opt_pk', metadata,
              Column('id', Integer, Sequence('tab_id_seq', optional=True),
                     primary_key=True),
              Column('data', String(50))
              )

    def test_insert_roundtrip(self):
        config.db.execute(
            self.tables.seq_pk.insert(),
            data="some data"
        )
        self._assert_round_trip(self.tables.seq_pk, config.db)

    def test_insert_lastrowid(self):
        r = config.db.execute(
            self.tables.seq_pk.insert(),
            data="some data"
        )
        eq_(
            r.inserted_primary_key,
            [1]
        )

    def test_nextval_direct(self):
        r = config.db.execute(
            self.tables.seq_pk.c.id.default
        )
        eq_(
            r, 1
        )

    @requirements.sequences_optional
    def test_optional_seq(self):
        r = config.db.execute(
            self.tables.seq_opt_pk.insert(),
            data="some data"
        )
        eq_(
            r.inserted_primary_key,
            [1]
        )

    def _assert_round_trip(self, table, conn):
        row = conn.execute(table.select()).first()
        eq_(
            row,
            (1, "some data")
        )


class HasSequenceTest(fixtures.TestBase):
    __requires__ = 'sequences',
    __backend__ = True

    def test_has_sequence(self):
        s1 = Sequence('user_id_seq')
        testing.db.execute(schema.CreateSequence(s1))
        try:
            eq_(testing.db.dialect.has_sequence(testing.db,
                                                'user_id_seq'), True)
        finally:
            testing.db.execute(schema.DropSequence(s1))

    @testing.requires.schemas
    def test_has_sequence_schema(self):
        s1 = Sequence('user_id_seq', schema=config.test_schema)
        testing.db.execute(schema.CreateSequence(s1))
        try:
            eq_(testing.db.dialect.has_sequence(
                testing.db, 'user_id_seq', schema=config.test_schema), True)
        finally:
            testing.db.execute(schema.DropSequence(s1))

    def test_has_sequence_neg(self):
        eq_(testing.db.dialect.has_sequence(testing.db, 'user_id_seq'),
            False)

    @testing.requires.schemas
    def test_has_sequence_schemas_neg(self):
        eq_(testing.db.dialect.has_sequence(testing.db, 'user_id_seq',
                                            schema=config.test_schema),
            False)

    @testing.requires.schemas
    def test_has_sequence_default_not_in_remote(self):
        s1 = Sequence('user_id_seq')
        testing.db.execute(schema.CreateSequence(s1))
        try:
            eq_(testing.db.dialect.has_sequence(testing.db, 'user_id_seq',
                                                schema=config.test_schema),
                False)
        finally:
            testing.db.execute(schema.DropSequence(s1))

    @testing.requires.schemas
    def test_has_sequence_remote_not_in_default(self):
        s1 = Sequence('user_id_seq', schema=config.test_schema)
        testing.db.execute(schema.CreateSequence(s1))
        try:
            eq_(testing.db.dialect.has_sequence(testing.db, 'user_id_seq'),
                False)
        finally:
            testing.db.execute(schema.DropSequence(s1))

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0088 ]--