How to use the leather.ticks.score_time.ScoreTimeTicker function in leather

To help you get started, we’ve selected a few leather examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wireservice / leather / tests / test_ticks.py View on Github external
def test_years(self):
        ticker = ScoreTimeTicker(
            date(2010, 1, 1),
            date(2015, 1, 1)
        )

        self.assertIsInstance(ticker.ticks[0], date)
        self.assertIs(ticker._to_unit, utils.to_year_count)
github wireservice / leather / tests / test_ticks.py View on Github external
def test_months_for_years(self):
        ticker = ScoreTimeTicker(
            date(2011, 1, 1),
            date(2013, 1, 1)
        )

        self.assertIsInstance(ticker.ticks[0], date)
        self.assertIs(ticker._to_unit, utils.to_month_count)
github wireservice / leather / tests / test_ticks.py View on Github external
def test_years_datetime(self):
        ticker = ScoreTimeTicker(
            datetime(2011, 1, 1),
            datetime(2015, 1, 1)
        )

        self.assertIsInstance(ticker.ticks[0], datetime)
        self.assertIs(ticker._to_unit, utils.to_year_count)
github wireservice / leather / tests / test_ticks.py View on Github external
def test_hours(self):
        ticker = ScoreTimeTicker(
            datetime(2011, 3, 5, 2),
            datetime(2011, 3, 5, 10)
        )

        self.assertIsInstance(ticker.ticks[0], datetime)
        self.assertIs(ticker._to_unit, utils.to_hour_count)
github wireservice / leather / tests / test_ticks.py View on Github external
def test_minutes(self):
        ticker = ScoreTimeTicker(
            datetime(2011, 3, 5, 2, 15),
            datetime(2011, 3, 5, 2, 45)
        )

        self.assertIsInstance(ticker.ticks[0], datetime)
        self.assertIs(ticker._to_unit, utils.to_minute_count)
github wireservice / leather / tests / test_ticks.py View on Github external
def test_microseconds(self):
        ticker = ScoreTimeTicker(
            datetime(2011, 3, 5, 2, 15, 15, 1000),
            datetime(2011, 3, 5, 2, 15, 15, 5000)
        )

        self.assertIsInstance(ticker.ticks[0], datetime)
        self.assertIs(ticker._to_unit, utils.to_microsecond_count)
github wireservice / leather / tests / test_ticks.py View on Github external
def test_months(self):
        ticker = ScoreTimeTicker(
            date(2011, 3, 1),
            date(2011, 7, 1)
        )

        self.assertIsInstance(ticker.ticks[0], date)
        self.assertIs(ticker._to_unit, utils.to_month_count)
github wireservice / leather / tests / test_ticks.py View on Github external
def test_minutes_for_hours(self):
        ticker = ScoreTimeTicker(
            datetime(2011, 3, 5, 2),
            datetime(2011, 3, 5, 3)
        )

        self.assertIsInstance(ticker.ticks[0], datetime)
        self.assertIs(ticker._to_unit, utils.to_minute_count)
github wireservice / leather / tests / test_ticks.py View on Github external
def test_seconds(self):
        ticker = ScoreTimeTicker(
            datetime(2011, 3, 5, 2, 15, 15),
            datetime(2011, 3, 5, 2, 15, 45)
        )

        self.assertIsInstance(ticker.ticks[0], datetime)
        self.assertIs(ticker._to_unit, utils.to_second_count)
github wireservice / leather / tests / test_ticks.py View on Github external
def test_days_for_months(self):
        ticker = ScoreTimeTicker(
            date(2011, 3, 1),
            date(2011, 5, 1)
        )

        self.assertIsInstance(ticker.ticks[0], date)
        self.assertIs(ticker._to_unit, utils.to_day_count)