Пример #1
0
 def test_NotHalfDay(self, ms):
     cal = get_calendar('NYSE')
     rule = NotHalfDay()
     rule.cal = cal
     should_trigger = rule.should_trigger
     self.assertTrue(should_trigger(FULL_DAY))
     self.assertFalse(should_trigger(HALF_DAY))
Пример #2
0
 def test_NotHalfDay(self, ms):
     cal = get_calendar('NYSE')
     rule = NotHalfDay()
     rule.cal = cal
     should_trigger = rule.should_trigger
     self.assertTrue(should_trigger(FULL_DAY))
     self.assertFalse(should_trigger(HALF_DAY))
Пример #3
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))
Пример #4
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))
Пример #5
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))
Пример #6
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))
Пример #7
0
 def test_NotHalfDay(self):
     should_trigger = partial(NotHalfDay().should_trigger, env=self.env)
     self.assertTrue(should_trigger(FULL_DAY))
     self.assertFalse(should_trigger(HALF_DAY))
Пример #8
0
 def test_NotHalfDay(self):
     should_trigger = NotHalfDay().should_trigger
     self.assertTrue(should_trigger(FULL_DAY))
     self.assertFalse(should_trigger(HALF_DAY))