Skip to content

Commit

Permalink
Add Firebase connection
Browse files Browse the repository at this point in the history
  • Loading branch information
LEO-E-100 committed Aug 28, 2017
1 parent 7dbc3cd commit 01b2800
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 89 deletions.
204 changes: 129 additions & 75 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file modified UGO.db
Binary file not shown.
2 changes: 0 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ def mysql():
# TODO Check SQLite port and ensure that port blocking is not the problem
# https://stackoverflow.com/questions/45567007/sqlite-and-flask-insert-statement-error
# Method runs as expected from `database.py` but no database insert is made from here


return 'OK', 200


Expand Down
18 changes: 18 additions & 0 deletions app_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os
import app
import unittest
import tempfile


class FlaskTestCase(unittest.TestCase):

def setUp(self):
app.app.testing = True
self.app = app.app.test_client()

def test_text_protocol(self):
rv = self.app.get('/')
assert b'JSON Posted' in rv.data

if __name__ == '__main__':
unittest.main()
8 changes: 4 additions & 4 deletions firebase_schema.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"feedback" : {
"feedback" : {
"report1" : {
"Rating" : "3",
"Service" : "RW3RE"
}
"Rating" : "3",
"Service" : "RW3RE"
}
}
}
12 changes: 4 additions & 8 deletions firebase_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@


count = 0
# @app.route(‘/api/put’, methods=[‘GET’, ‘POST’])


def fireput():

global count
count += 1
insert_data = {'Rating' : feedback, 'Service' : service_id}
insert_data = {'Rating': feedback, 'Service': service_id}
firebase.put('/feedback', 'report' + str(count), insert_data)

fireput()

service_id = "TEST"
feedback = 10

fireput()

print(count)
print(count)

0 comments on commit 01b2800

Please sign in to comment.