How to use the tekore._model.serialise.Timestamp.from_string function in tekore

To help you get started, we’ve selected a few tekore 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 felix-hilden / spotipy / tests / model.py View on Github external
def test_initialisable_with_millisecond_precision(self):
        Timestamp.from_string('2019-01-01T12:00:00.00Z')
github felix-hilden / spotipy / tests / model.py View on Github external
def test_initialisable_with_microsecond_precision(self):
        Timestamp.from_string('2019-01-01T12:00:00.000000Z')
github felix-hilden / spotipy / tests / model.py View on Github external
def test_timestamp_in_dataclass(self):
        @dataclass(repr=False)
        class C(Model):
            v: Timestamp

        c = C(Timestamp.from_string('2019-01-01T12:00:00Z'))
        assert isinstance(c.asbuiltin()['v'], str)
        assert c.json() == '{"v": "2019-01-01T12:00:00Z"}'
github felix-hilden / spotipy / tests / model.py View on Github external
def test_timestamp_initialisable_from_string(self):
        Timestamp.from_string('2019-01-01T12:00:00Z')
github felix-hilden / spotipy / tekore / _model / track.py View on Github external
def __post_init__(self):
        self.added_at = Timestamp.from_string(self.added_at)
        self.track = FullTrack(**self.track)