@@ -90,48 +90,6 @@ def test_sa_crud_with_add_declare(self):
9090 self .test_sa_crud (connection )
9191
9292
93- class TestDirectories (TablesTest ):
94- __backend__ = True
95-
96- def prepare_table (self , engine ):
97- base = declarative_base ()
98-
99- class Table (base ):
100- __tablename__ = "dir/test"
101- id = Column (Integer , primary_key = True )
102- text = Column (Unicode )
103-
104- base .metadata .create_all (engine )
105- session = sessionmaker (bind = engine )()
106- session .add (Table (id = 2 , text = "foo" ))
107- session .commit ()
108- return base , Table , session
109-
110- def try_update (self , session , Table ):
111- row = session .query (Table ).first ()
112- row .text = "bar"
113- session .commit ()
114- return row
115-
116- def drop_table (self , base , engine ):
117- base .metadata .drop_all (engine )
118-
119- def test_directories (self ):
120- engine_good = sa .create_engine (config .db_url , has_directories = True )
121- base , Table , session = self .prepare_table (engine_good )
122- row = self .try_update (session , Table )
123- assert row .id == 2
124- assert row .text == "bar"
125- self .drop_table (base , engine_good )
126-
127- engine_bad = sa .create_engine (config .db_url )
128- base , Table , session = self .prepare_table (engine_bad )
129- with pytest .raises (Exception ) as excinfo :
130- self .try_update (session , Table )
131- assert "Unknown name: $dir" in str (excinfo .value )
132- self .drop_table (base , engine_bad )
133-
134-
13593class TestSimpleSelect (TablesTest ):
13694 __backend__ = True
13795
0 commit comments