Skip to content

Commit

Permalink
Hack to Make This Works with Zapier
Browse files Browse the repository at this point in the history
  • Loading branch information
super3 committed Aug 13, 2015
1 parent 1228517 commit 433679a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dataserv/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys
import os.path
import datetime
from random import randint
from flask import make_response, jsonify
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))

Expand Down Expand Up @@ -107,7 +108,7 @@ def total():
# return in TB the number
app.config["BYTE_SIZE"] = 1024*1024*128
result = total_shards * (app.config["BYTE_SIZE"] / (1024*1024*1024*1024)) # bytes / 1 TB
json_data = {'total_TB': round(result, 2)}
json_data = { 'id': randint(0,9999999) ,'total_TB': round(result, 2) }

return jsonify(json_data)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_App.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,6 @@ def test_farmer_total_bytes(self):

# check total bytes
rv = self.app.get('/api/total')
json_data = b'{\n "total_TB": 1.22\n}'
json_data = b'"total_TB": 1.22\n}'

self.assertEqual(json_data, rv.data)
self.assertTrue(json_data in rv.data)

0 comments on commit 433679a

Please sign in to comment.