Example #1
0
    def test_NotHalfDay(self):
        rule = NotHalfDay()
        rule.cal = self.cal

        if self.HALF_SESSION:
            for minute in self.cal.minutes_for_session(self.HALF_SESSION):
                self.assertFalse(rule.should_trigger(minute))

        if self.FULL_SESSION:
            for minute in self.cal.minutes_for_session(self.FULL_SESSION):
                self.assertTrue(rule.should_trigger(minute))
Example #2
0
    def test_NotHalfDay(self):
        rule = NotHalfDay()
        rule.cal = self.cal

        if self.HALF_SESSION:
            for minute in self.cal.minutes_for_session(self.HALF_SESSION):
                self.assertFalse(rule.should_trigger(minute))

        if self.FULL_SESSION:
            for minute in self.cal.minutes_for_session(self.FULL_SESSION):
                self.assertTrue(rule.should_trigger(minute))
Example #3
0
    def test_NotHalfDay(self):
        rule = NotHalfDay()
        rule.cal = self.nyse_cal

        half_day_period = pd.Timestamp("2014-07-03", tz='UTC')
        full_day_period = pd.Timestamp("2014-09-24", tz='UTC')

        for minute in self.nyse_cal.minutes_for_session(half_day_period):
            self.assertFalse(rule.should_trigger(minute))

        for minute in self.nyse_cal.minutes_for_session(full_day_period):
            self.assertTrue(rule.should_trigger(minute))
Example #4
0
    def test_NotHalfDay(self):
        rule = NotHalfDay()
        rule.cal = self.nyse_cal

        half_day_period = pd.Timestamp("2014-07-03", tz='UTC')
        full_day_period = pd.Timestamp("2014-09-24", tz='UTC')

        for minute in self.nyse_cal.minutes_for_session(half_day_period):
            self.assertFalse(rule.should_trigger(minute))

        for minute in self.nyse_cal.minutes_for_session(full_day_period):
            self.assertTrue(rule.should_trigger(minute))