<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> from salttesting import TestCase , skipIf <EOL> from salttesting . mock import ( <EOL> NO_MOCK , <EOL> NO_MOCK_REASON <EOL> ) <EOL> from salttesting . helpers import ensure_in_syspath <EOL> ensure_in_syspath ( '<STR_LIT>' ) <EOL> from salt . modules import sqlite3 <EOL> import salt <EOL> class MockSqlite3 ( object ) : <EOL> '''<STR_LIT>''' <EOL> version = '<STR_LIT>' <EOL> sqlite_version = '<STR_LIT>' <EOL> def __init__ ( self ) : <EOL> self . dbase = None <EOL> self . isolation_level = None <EOL> def connect ( self , dbase , isolation_level = None ) : <EOL> '''<STR_LIT>''' <EOL> self . dbase = dbase <EOL> self . isolation_level = isolation_level <EOL> return MockSqlite3 ( ) <EOL> @ staticmethod <EOL> def cursor ( ) : <EOL> '''<STR_LIT>''' <EOL> return MockSqlite3 ( ) <EOL> @ staticmethod <EOL> def execute ( sql ) : <EOL> '''<STR_LIT>''' <EOL> return sql <EOL> @ staticmethod <EOL> def fetchall ( ) : <EOL> '''<STR_LIT>''' <EOL> return True <EOL> salt . modules . sqlite3 . sqlite3 = MockSqlite3 ( ) <EOL> @ skipIf ( NO_MOCK , NO_MOCK_REASON ) <EOL> class Sqlite3TestCase ( TestCase ) : <EOL> '''<STR_LIT>''' <EOL> def test_version ( self ) : <EOL> '''<STR_LIT>''' <EOL> self . assertEqual ( sqlite3 . version ( ) , '<STR_LIT>' ) <EOL> def test_sqlite_version ( self ) : <EOL> '''<STR_LIT>''' <EOL> self . assertEqual ( sqlite3 . sqlite_version ( ) , '<STR_LIT>' ) <EOL> def test_modify ( self ) : <EOL> '''<STR_LIT>''' <EOL> self . assertFalse ( sqlite3 . modify ( ) ) <EOL> self . assertTrue ( sqlite3 . modify <EOL> ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) ) <EOL> def test_fetch ( self ) : <EOL> '''<STR_LIT>''' <EOL> self . assertFalse ( sqlite3 . fetch ( ) ) <EOL> self . assertTrue ( sqlite3 . fetch <EOL> ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) ) <EOL> def test_tables ( self ) : <EOL> '''<STR_LIT>''' <EOL> self . assertFalse ( sqlite3 . tables ( ) ) <EOL> self . assertTrue ( sqlite3 . tables ( '<STR_LIT>' ) ) <EOL> def test_indices ( self ) : <EOL> '''<STR_LIT>''' <EOL> self . assertFalse ( sqlite3 . indices ( ) ) <EOL> self . assertTrue ( sqlite3 . indices ( '<STR_LIT>' ) ) <EOL> def test_indexes ( self ) : <EOL> '''<STR_LIT>''' <EOL> self . assertTrue ( sqlite3 . indexes ( '<STR_LIT>' ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from integration import run_tests <EOL> run_tests ( Sqlite3TestCase , needs_daemon = False ) </s>
