Beispiel #1
0
    def test_cached_range(self):
        DatetimeIndex._cached_range(START, END, offset=CDay())
        DatetimeIndex._cached_range(START, periods=20,
                                    offset=CDay())
        DatetimeIndex._cached_range(end=START, periods=20,
                                    offset=CDay())

        self.assertRaises(Exception, DatetimeIndex._cached_range, START, END)

        self.assertRaises(Exception, DatetimeIndex._cached_range, START,
                          freq=CDay())

        self.assertRaises(Exception, DatetimeIndex._cached_range, end=END,
                          freq=CDay())

        self.assertRaises(Exception, DatetimeIndex._cached_range, periods=20,
                          freq=CDay())
Beispiel #2
0
    def test_cached_range(self):
        DatetimeIndex._cached_range(START, END, offset=BDay())
        DatetimeIndex._cached_range(START, periods=20, offset=BDay())
        DatetimeIndex._cached_range(end=START, periods=20, offset=BDay())

        self.assertRaisesRegexp(TypeError, "offset",
                                DatetimeIndex._cached_range,
                                START, END)

        self.assertRaisesRegexp(TypeError, "specify period",
                                DatetimeIndex._cached_range, START,
                                offset=BDay())

        self.assertRaisesRegexp(TypeError, "specify period",
                                DatetimeIndex._cached_range, end=END,
                                offset=BDay())

        self.assertRaisesRegexp(TypeError, "start or end",
                                DatetimeIndex._cached_range, periods=20,
                                offset=BDay())
Beispiel #3
0
    def test_cached_range(self):
        DatetimeIndex._cached_range(START, END, freq=CDay())
        DatetimeIndex._cached_range(START, periods=20,
                                    freq=CDay())
        DatetimeIndex._cached_range(end=START, periods=20,
                                    freq=CDay())

        # with pytest.raises(TypeError):
        with tm.assert_raises_regex(TypeError, "freq"):
            DatetimeIndex._cached_range(START, END)

        # with pytest.raises(TypeError):
        with tm.assert_raises_regex(TypeError, "specify period"):
            DatetimeIndex._cached_range(START, freq=CDay())

        # with pytest.raises(TypeError):
        with tm.assert_raises_regex(TypeError, "specify period"):
            DatetimeIndex._cached_range(end=END, freq=CDay())

        # with pytest.raises(TypeError):
        with tm.assert_raises_regex(TypeError, "start or end"):
            DatetimeIndex._cached_range(periods=20, freq=CDay())
Beispiel #4
0
    def test_cached_range(self):
        DatetimeIndex._cached_range(START, END, offset=BDay())
        DatetimeIndex._cached_range(START, periods=20, offset=BDay())
        DatetimeIndex._cached_range(end=START, periods=20, offset=BDay())

        with tm.assert_raises_regex(TypeError, "offset"):
            DatetimeIndex._cached_range(START, END)

        with tm.assert_raises_regex(TypeError, "specify period"):
            DatetimeIndex._cached_range(START, offset=BDay())

        with tm.assert_raises_regex(TypeError, "specify period"):
            DatetimeIndex._cached_range(end=END, offset=BDay())

        with tm.assert_raises_regex(TypeError, "start or end"):
            DatetimeIndex._cached_range(periods=20, offset=BDay())
    def test_cached_range(self):
        DatetimeIndex._cached_range(START, END, offset=BDay())
        DatetimeIndex._cached_range(START, periods=20, offset=BDay())
        DatetimeIndex._cached_range(end=START, periods=20, offset=BDay())

        with tm.assert_raises_regex(TypeError, "offset"):
            DatetimeIndex._cached_range(START, END)

        with tm.assert_raises_regex(TypeError, "specify period"):
            DatetimeIndex._cached_range(START, offset=BDay())

        with tm.assert_raises_regex(TypeError, "specify period"):
            DatetimeIndex._cached_range(end=END, offset=BDay())

        with tm.assert_raises_regex(TypeError, "start or end"):
            DatetimeIndex._cached_range(periods=20, offset=BDay())
Beispiel #6
0
    def test_cached_range(self):
        DatetimeIndex._cached_range(START, END, freq=CDay())
        DatetimeIndex._cached_range(START, periods=20, freq=CDay())
        DatetimeIndex._cached_range(end=START, periods=20, freq=CDay())

        # with pytest.raises(TypeError):
        with tm.assert_raises_regex(TypeError, "freq"):
            DatetimeIndex._cached_range(START, END)

        # with pytest.raises(TypeError):
        with tm.assert_raises_regex(TypeError, "specify period"):
            DatetimeIndex._cached_range(START, freq=CDay())

        # with pytest.raises(TypeError):
        with tm.assert_raises_regex(TypeError, "specify period"):
            DatetimeIndex._cached_range(end=END, freq=CDay())

        # with pytest.raises(TypeError):
        with tm.assert_raises_regex(TypeError, "start or end"):
            DatetimeIndex._cached_range(periods=20, freq=CDay())