Skip to content

Commit

Permalink
Not Longer Ingoring Online API Function. Adding Proper Coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
super3 committed Jun 15, 2015
1 parent d65173d commit 049eced
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dataserv/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


# Helper functions
def secs_to_mins(seconds): # pragma: no cover
def secs_to_mins(seconds):
if seconds < 60:
return "{0} second(s)".format(int(seconds))
elif seconds < 3600:
Expand Down
11 changes: 10 additions & 1 deletion tests/test_App.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest
from dataserv.app import app
from dataserv.Farmer import db
from dataserv.app import app, secs_to_mins


class AppTest(unittest.TestCase):
Expand Down Expand Up @@ -72,3 +72,12 @@ def test_ping_invalid_address(self):
# good ping
self.assertEqual(b"Ping Failed: Invalid BTC Address.", rv.data)
self.assertEqual(rv.status_code, 400)

def test_helper_time(self):
time1 = 15
time2 = 75
time3 = 4000

self.assertEqual(secs_to_mins(time1), "15 second(s)")
self.assertEqual(secs_to_mins(time2), "1 minute(s)")
self.assertEqual(secs_to_mins(time3), "1 hour(s)")

0 comments on commit 049eced

Please sign in to comment.