@@ -175,7 +175,7 @@ def test_add(self):
175
175
secondCat = self .strIndex + self .strIndex
176
176
177
177
self .assert_ (tm .equalContents (np .append (self .strIndex ,
178
- self .dateIndex ), firstCat ))
178
+ self .dateIndex ), firstCat ))
179
179
self .assert_ (tm .equalContents (secondCat , self .strIndex ))
180
180
tm .assert_contains_all (self .strIndex , firstCat .indexMap )
181
181
tm .assert_contains_all (self .strIndex , secondCat .indexMap )
@@ -184,6 +184,17 @@ def test_add(self):
184
184
# this is valid too
185
185
shifted = self .dateIndex + timedelta (1 )
186
186
187
+ def test_append_multiple (self ):
188
+ index = Index (['a' , 'b' , 'c' , 'd' , 'e' , 'f' ])
189
+
190
+ foos = [index [:2 ], index [2 :4 ], index [4 :]]
191
+ result = foos [0 ].append (foos [1 :])
192
+ self .assert_ (result .equals (index ))
193
+
194
+ # empty
195
+ result = index .append ([])
196
+ self .assert_ (result .equals (index ))
197
+
187
198
def test_add_string (self ):
188
199
# from bug report
189
200
index = Index (['a' , 'b' , 'c' ])
@@ -602,6 +613,14 @@ def test_append(self):
602
613
result = self .index [:3 ].append (self .index [3 :])
603
614
self .assert_ (result .equals (self .index ))
604
615
616
+ foos = [self .index [:1 ], self .index [1 :3 ], self .index [3 :]]
617
+ result = foos [0 ].append (foos [1 :])
618
+ self .assert_ (result .equals (self .index ))
619
+
620
+ # empty
621
+ result = self .index .append ([])
622
+ self .assert_ (result .equals (self .index ))
623
+
605
624
def test_get_level_values (self ):
606
625
result = self .index .get_level_values (0 )
607
626
expected = ['foo' , 'foo' , 'bar' , 'baz' , 'qux' , 'qux' ]
0 commit comments