Skip to content

Commit

Permalink
add fitness schedule test
Browse files Browse the repository at this point in the history
  • Loading branch information
ezwang committed Jul 2, 2018
1 parent 88894a8 commit 52fb958
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ environment variables by default.
LIBCAL_ID = 'MY_LIBCAL_ID'
LIBCAL_SECRET = 'MY_LIBCAL_SECRET'
FITNESS_TOKEN = 'MY_FITNESS_TOKEN'
Then run ``make test`` to run all tests in your shell.

Contributing & Bug Reporting
Expand Down
2 changes: 2 additions & 0 deletions tests/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@

LIBCAL_ID = os.getenv('LIBCAL_ID')
LIBCAL_SECRET = os.getenv('LIBCAL_SECRET')

FITNESS_TOKEN = os.getenv('FITNESS_TOKEN')
8 changes: 7 additions & 1 deletion tests/fitness_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
class TestFitness(unittest.TestCase):

def setUp(self):
self.fitness = Fitness()
from .credentials import FITNESS_TOKEN

self.fitness = Fitness(FITNESS_TOKEN)

def test_usage(self):
usage = self.fitness.get_usage()
Expand All @@ -16,3 +18,7 @@ def test_usage(self):
self.assertTrue("open" in item)
self.assertTrue("updated" in item)
self.assertTrue("percent" in item)

def test_schedule(self):
schedule = self.fitness.get_schedule()
self.assertTrue(len(schedule) > 0)

0 comments on commit 52fb958

Please sign in to comment.