Skip to content

Instantly share code, notes, and snippets.

@sjainit
Last active December 16, 2019 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjainit/ab3ee57e7523da3ed6c587b850745776 to your computer and use it in GitHub Desktop.
Save sjainit/ab3ee57e7523da3ed6c587b850745776 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 15 20:12:56 2019
@author: sarthak
"""
from time import time
from datetime import datetime
import listenbrainz_spark
from listenbrainz_spark import stats
from listenbrainz_spark.tests import SparkTestCase
class InitTestCase(SparkTestCase):
def test_replace_days(self):
self.assertEqual(stats.replace_days(datetime.datetime(2019,5,12),13),datetime.datetime(2019,5,13,0,0))
def test_adjust_months(self):
self.assertEqual(stats.adjust_months(datetime.datetime(2019,5,12),3,True),datetime.datetime(2019,2,12,0,0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment