@@ -113,6 +113,8 @@ def test_put(self):
113
113
self .store ['a' ] = ts
114
114
self .store ['b' ] = df [:10 ]
115
115
self .store ['foo/bar/bah' ] = df [:10 ]
116
+ self .store ['foo' ] = df [:10 ]
117
+ self .store ['/foo' ] = df [:10 ]
116
118
self .store .put ('c' , df [:10 ], table = True )
117
119
118
120
# not OK, not a table
@@ -170,6 +172,19 @@ def test_append(self):
170
172
store .append ('df2' , df [10 :])
171
173
tm .assert_frame_equal (store ['df2' ], df )
172
174
175
+ store .append ('/df3' , df [:10 ])
176
+ store .append ('/df3' , df [10 :])
177
+ tm .assert_frame_equal (store ['df3' ], df )
178
+
179
+ # this is allowed by almost always don't want to do it
180
+ import warnings
181
+ import tables
182
+ warnings .filterwarnings ('ignore' , category = tables .NaturalNameWarning )
183
+ store .append ('/df3 foo' , df [:10 ])
184
+ store .append ('/df3 foo' , df [10 :])
185
+ tm .assert_frame_equal (store ['df3 foo' ], df )
186
+ warnings .filterwarnings ('always' , category = tables .NaturalNameWarning )
187
+
173
188
wp = tm .makePanel ()
174
189
store .append ('wp1' , wp .ix [:,:10 ,:])
175
190
store .append ('wp1' , wp .ix [:,10 :,:])
@@ -319,7 +334,6 @@ def test_remove(self):
319
334
self .store .remove ('b' )
320
335
self .assertEquals (len (self .store ), 1 )
321
336
322
-
323
337
# __delitem__
324
338
self .store ['a' ] = ts
325
339
self .store ['b' ] = df
@@ -342,6 +356,17 @@ def test_remove_where(self):
342
356
expected = wp .reindex (minor_axis = ['B' ,'C' ])
343
357
tm .assert_panel_equal (rs ,expected )
344
358
359
+ # empty where
360
+ self .store .remove ('wp' )
361
+ self .store .put ('wp' , wp , table = True )
362
+ self .store .remove ('wp' , [])
363
+
364
+ # non - empty where
365
+ self .store .remove ('wp' )
366
+ self .store .put ('wp' , wp , table = True )
367
+ self .assertRaises (Exception , self .store .remove ,
368
+ 'wp' , ['foo' ])
369
+
345
370
# selectin non-table with a where
346
371
self .store .put ('wp2' , wp , table = False )
347
372
self .assertRaises (Exception , self .store .remove ,
0 commit comments