coverage.py v4.2, - created at 2016-12-10 22:39 + created at 2017-01-01 14:17
diff --git a/htmlcov/index.html b/htmlcov/index.html index 126dc28..4cb60e8 100644 --- a/htmlcov/index.html +++ b/htmlcov/index.html @@ -143,7 +143,7 @@
coverage.py v4.2, - created at 2016-12-10 22:39 + created at 2017-01-01 14:17
« index coverage.py v4.2, - created at 2016-12-10 22:08 + created at 2017-01-01 14:13
« index coverage.py v4.2, - created at 2016-12-10 22:08 + created at 2017-01-01 14:13
from coverage import coverage
cov = coverage(branch=True, omit=['/usr/local/lib/python2.7/dist-packages/*',
'/usr/local/lib/python2.7/site-packages/*',
-'test_app.py', 'config.py', 'test_config.py'])
-cov.start()
-cov.exclude('pragma')
--
import unittest
-import json
-from app import db, app, Person, Event, Group
-- -
- -
"""
-Creates a new database for the unit test to use
-"""
- - - -- - -
- - -
- - -
email='abc@columbia.edu',
-password='passwd',
-lastname='ab',
-firstname='cd'
-)))
- -- - -
email='abc@columbia.edu',
-password='passwd',
-lastname='ab',
-firstname='cd'
-)))
-# Duplicate accounts
- -email='abc@columbia.edu',
-password='passwd',
-lastname='ab',
-firstname='cd'
-)))
-- -
- -
'''
-Missing email, password, firstname, lastname
-'''
- -password='passwd',
-firstname='cd',
-lastname='ab'
-)))
- -- -
email='abc@columbia.edu',
-firstname='cd',
-lastname='ab'
-)))
- -- -
email='abc@columbia.edu',
-password='passwd',
-lastname='ab'
-)))
- -- -
email='abc@columbia.edu',
-password='passwd',
-firstname='cd'
-)))
- -+
'/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/*',
+'test_app.py', 'config.py', 'test_config.py'])
+cov.start()
+cov.exclude('pragma')
++
import unittest
+import json
+from app import db, app, Person, Event, Group
++ +
+ +
"""
+Creates a new database for the unit test to use
+"""
+ + + ++ + +
+ + +
+ + +
email='abc@columbia.edu',
+password='passwd',
+lastname='ab',
+firstname='cd'
+)))
+ ++ + +
email='abc@columbia.edu',
+password='passwd',
+lastname='ab',
+firstname='cd'
+)))
+# Duplicate accounts
+ +email='abc@columbia.edu',
+password='passwd',
+lastname='ab',
+firstname='cd'
+)))
++ +
+ +
'''
+Missing email, password, firstname, lastname
+'''
+ +password='passwd',
+firstname='cd',
+lastname='ab'
+)))
+ ++ +
email='abc@columbia.edu',
+firstname='cd',
+lastname='ab'
+)))
+ ++ +
email='abc@columbia.edu',
+password='passwd',
+lastname='ab'
+)))
+ ++ +
email='abc@columbia.edu',
+password='passwd',
+firstname='cd'
+)))
+- -
- -
"""
-Creates a new database for the unit test to use
-"""
- - - -- -
-
# Create test user
- -'validuser@columbia.edu',
-'validpassword',
-'test',
-'testerson'
-)
- - -- -
- - -
- - -
exist_email='validuser@columbia.edu',
-exist_password='validpassword'
-)))
- -- - -
exist_email='wronguser@columbia.edu',
-exist_password='validpassword'
-)))
- -- - -
exist_email='validuser@columbia.edu',
-exist_password='wrongpassword'
-)))
- -- -
- -
"""
-Creates a new database for the unit test to use
-"""
- - - -- - -
- - -
- - - -
+
+ +
+ +
"""
+Creates a new database for the unit test to use
+"""
+ + + ++ +
+
# Create test user
+ +'validuser@columbia.edu',
+'validpassword',
+'test',
+'testerson'
+)
+ + ++ +
+ + +
+ + +
exist_email='validuser@columbia.edu',
+exist_password='validpassword'
+)))
+ ++ + +
exist_email='wronguser@columbia.edu',
+exist_password='validpassword'
+)))
+ ++ + +
exist_email='validuser@columbia.edu',
+exist_password='wrongpassword'
+)))
+ ++ +
+ +
"""
+Creates a new database for the unit test to use
+"""
+ + + ++ + +
+ + +
+ + +
- -
- -
"""
-Creates a new database for the unit test to use
-"""
- - - -- - -
- -
- -
email='abc@columbia.edu',
-password='passwd',
-lastname='ab',
-firstname='cd'
-)))
-- -
exist_email='abc@columbia.edu',
-exist_password='passwd'
-)))
-+
+ +
+ +
"""
+Creates a new database for the unit test to use
+"""
+ + + ++ + +
+ +
+ +
email='abc@columbia.edu',
+password='passwd',
+lastname='ab',
+firstname='cd'
+)))
++ +
exist_email='abc@columbia.edu',
+exist_password='passwd'
+)))
- - -
+
+ +
- - -
content_type='application/json'
-)
- - -- -
# Add a group to test DB
- -'group_id': '456',
-'group': 'testgroup'
-}))
-# Add an event to test DB
- -- -
'id': '000',
-'group_id': '456'
-}))
- - -content_type='application/json'
-)
- - -- -
# Add a group to test DB
- -'group_id': '456',
-'group': 'testgroup'
-})
- - -# Add an event to test DB
- -- -
'id': '123',
-'datetime': '1993-11-17T12:00:00',
-'location': 'mars',
-'group_id': '456',
-'title': 'a new event',
-'url': 'http://www.testevent.com',
-'photo_url': 'http://www.testphotourl.com'
-}))
-- -
- -
content_type='application/json'
-)
- - -+
+ + +
content_type='application/json'
+)
+ + ++ +
# Add a group to test DB
+ +'group_id': '456',
+'group': 'testgroup'
+}))
+# Add an event to test DB
+ ++ +
'id': '000',
+'group_id': '456'
+}))
+ + +content_type='application/json'
+)
+ + ++ +
# Add a group to test DB
+ +'group_id': '456',
+'group': 'testgroup'
+})
+ + +# Add an event to test DB
+ ++ +
'id': '123',
+'datetime': '1993-11-17T12:00:00',
+'location': 'mars',
+'group_id': '456',
+'title': 'a new event',
+'url': 'http://www.testevent.com',
+'photo_url': 'http://www.testphotourl.com'
+}))
++ +
+ +
content_type='application/json'
+)
+ +- -
- -
"""
-Creates a new database for the unit test to use
-"""
- - - -- -
- -
'asdf123@columbia.edu',
-'asdf',
-'test',
-'testerson'
-)
-- - -
'group_id':'12345',
-'group':'groupname'
-}))
- - -'id': '123',
-'datetime': '1993-11-17T12:00:00',
-'location': 'mars',
-'group_id':'12345',
-'group': 'columbiagroup',
-'title': 'a new event',
-'group_url': 'http://www.google.com'
-}))
-- -
- -
exist_email='asdf123@columbia.edu',
-exist_password='asdf'
-)))
-- -
- - -
- - -
id='123'
-)))
- -- -
id='123'
-)))
- -- - -
id='123'
-)))
- -- -
id='123'
-)))
- -- - -
id='123'
-)))
- -- -
- -
"""
-Creates a new database for the unit test to use
-"""
- - - -- -
- -
'asdf123@columbia.edu',
-'asdf',
-'test',
-'testerson'
-)
-- - -
'group_id':'12345',
-'group':'groupname'
-}))
- - -'id': '123',
-'datetime': '1993-11-17T12:00:00',
-'location': 'mars',
-'group_id': '12345',
-'title': 'a new event',
-'url': 'http://www.testevent.com',
-'photo_url': 'http://www.testphotourl.com'
-}))
-- -
- -
exist_email='asdf123@columbia.edu',
-exist_password='asdf'
-)))
-- -
- - -
- - -
content_type='application/json'
-)
- - -- - -
group_id='12345',
-rate_value=1
-)))
- -- -
content_type='application/json'
-)
- - -- - -
group_id='12345',
-rate_value=1
-)))
- -- -
content_type='application/json'
-)
- - -- -
group_id='12345',
-rate_value=3
-)))
- -- -
content_type='application/json'
-)
- - --
if __name__ == '__main__':
-# with open('test_app.py') as f:
-# for l in f:
-# if 'def test_' in l and 'if' not in l:
-# print l.strip()
--
try:
-unittest.main()
-except:
-pass
-cov.stop()
-cov.save()
-print("\n\nCoverage Report:\n")
-cov.report()
--
cov.html_report()
-cov.erase()
++ +
+ +
"""
+Creates a new database for the unit test to use
+"""
+ + + ++ +
+ +
'asdf123@columbia.edu',
+'asdf',
+'test',
+'testerson'
+)
++ + +
'group_id':'12345',
+'group':'groupname'
+}))
+ + +'id': '123',
+'datetime': '1993-11-17T12:00:00',
+'location': 'mars',
+'group_id':'12345',
+'group': 'columbiagroup',
+'title': 'a new event',
+'group_url': 'http://www.google.com'
+}))
++ +
+ +
exist_email='asdf123@columbia.edu',
+exist_password='asdf'
+)))
++ +
+ + +
+ + +
id='123'
+)))
+ ++ +
id='123'
+)))
+ ++ + +
id='123'
+)))
+ ++ +
id='123'
+)))
+ ++ + +
id='123'
+)))
+ ++ +
+ +
"""
+Creates a new database for the unit test to use
+"""
+ + + ++ +
+ +
'asdf123@columbia.edu',
+'asdf',
+'test',
+'testerson'
+)
++ + +
'group_id':'12345',
+'group':'groupname'
+}))
+ + +'id': '123',
+'datetime': '1993-11-17T12:00:00',
+'location': 'mars',
+'group_id': '12345',
+'title': 'a new event',
+'url': 'http://www.testevent.com',
+'photo_url': 'http://www.testphotourl.com'
+}))
++ +
+ +
exist_email='asdf123@columbia.edu',
+exist_password='asdf'
+)))
++ +
+ + +
+ + +
content_type='application/json'
+)
+ + ++ + +
group_id='12345',
+rate_value=1
+)))
+ ++ +
content_type='application/json'
+)
+ + ++ + +
group_id='12345',
+rate_value=1
+)))
+ ++ +
content_type='application/json'
+)
+ + ++ +
group_id='12345',
+rate_value=3
+)))
+ ++ +
content_type='application/json'
+)
+ + ++
if __name__ == '__main__':
+# with open('test_app.py') as f:
+# for l in f:
+# if 'def test_' in l and 'if' not in l:
+# print l.strip()
++
try:
+unittest.main()
+except:
+pass
+cov.stop()
+cov.save()
+print("\n\nCoverage Report:\n")
+cov.report()
++
cov.html_report()
+cov.erase()
« index coverage.py v4.2, - created at 2016-12-10 22:08 + created at 2017-01-01 14:13
"""
flask_sqlalchemy: test_config.py
"""
- +#Flask-SQLAlchemy will log all the statements issued to stderr
#Flask-SQLAlchemy will track modifications of objects and emit signals.
@@ -102,7 +102,7 @@« index coverage.py v4.2, - created at 2016-12-10 22:08 + created at 2017-01-01 14:13