<s> import unittest <EOL> import mock <EOL> from docker_registry . lib . index import db <EOL> class TestVersion ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . version = db . Version ( ) <EOL> def test_repr ( self ) : <EOL> self . assertEqual ( type ( repr ( self . version ) ) , str ) <EOL> class TestRepository ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . repository = db . Repository ( ) <EOL> def test_repr ( self ) : <EOL> self . assertEqual ( type ( repr ( self . repository ) ) , str ) <EOL> class TestSQLAlchemyIndex ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . index = db . SQLAlchemyIndex ( database = "<STR_LIT>" ) <EOL> @ mock . patch ( '<STR_LIT>' , return_value = True ) <EOL> @ mock . patch ( '<STR_LIT>' ) <EOL> def test_setup_database ( self , first , has_table ) : <EOL> first = mock . Mock ( <EOL> side_effect = db . sqlalchemy . exc . OperationalError ) <EOL> self . assertRaises ( <EOL> NotImplementedError , db . SQLAlchemyIndex , database = "<STR_LIT>" ) </s>
