|
15 | 15 | from pandas.util.testing import assert_series_equal
|
16 | 16 | import pandas.util.testing as tm
|
17 | 17 |
|
18 |
| -from .common import TestData |
19 | 18 |
|
| 19 | +class TestSeriesCombine(): |
20 | 20 |
|
21 |
| -class TestSeriesCombine(TestData): |
22 |
| - |
23 |
| - def test_append(self): |
24 |
| - appendedSeries = self.series.append(self.objSeries) |
| 21 | + def test_append(self, datetime_series, string_series, object_series): |
| 22 | + appendedSeries = string_series.append(object_series) |
25 | 23 | for idx, value in compat.iteritems(appendedSeries):
|
26 |
| - if idx in self.series.index: |
27 |
| - assert value == self.series[idx] |
28 |
| - elif idx in self.objSeries.index: |
29 |
| - assert value == self.objSeries[idx] |
| 24 | + if idx in string_series.index: |
| 25 | + assert value == string_series[idx] |
| 26 | + elif idx in object_series.index: |
| 27 | + assert value == object_series[idx] |
30 | 28 | else:
|
31 | 29 | raise AssertionError("orphaned index!")
|
32 | 30 |
|
33 |
| - pytest.raises(ValueError, self.ts.append, self.ts, |
| 31 | + pytest.raises(ValueError, datetime_series.append, datetime_series, |
34 | 32 | verify_integrity=True)
|
35 | 33 |
|
36 |
| - def test_append_many(self): |
37 |
| - pieces = [self.ts[:5], self.ts[5:10], self.ts[10:]] |
| 34 | + def test_append_many(self, datetime_series): |
| 35 | + pieces = [datetime_series[:5], datetime_series[5:10], |
| 36 | + datetime_series[10:]] |
38 | 37 |
|
39 | 38 | result = pieces[0].append(pieces[1:])
|
40 |
| - assert_series_equal(result, self.ts) |
| 39 | + assert_series_equal(result, datetime_series) |
41 | 40 |
|
42 | 41 | def test_append_duplicates(self):
|
43 | 42 | # GH 13677
|
|
0 commit comments