#!/usr/bin/env python import penguicontrax import unittest penguicontrax.init() app = penguicontrax.app """ The best way to run this and other tests is to run: nosetests The unit tests do not require the web app to be running. It interacts with the Flask application directly. Should you want to see the stdout from these tests, set a unix shell variable like this: export NOSE_NOCAPTURE=1 """ class SimpleTest(unittest.TestCase): """Super simple unit tests to verify the app is functioning""" def setUp(self): pass #def test_bad(self): # self.assertEqual(1,0) def login(self): """Fake a social login by inserting data into the database and setting a session."""
#!/usr/bin/env python import penguicontrax import unittest penguicontrax.init() app = penguicontrax.app class SimpleTest(unittest.TestCase): def setUp(self): pass #def test_bad(self): # self.assertEqual(1,0) def test_index(self): print "Go time." t = penguicontrax.app.test_client(self) r = t.get('/', content_type='html/text') print "Testing baby!" print r self.assertEqual(r.status_code, 200) assert b'penguicon-trax' in r.data if __name__ == "__main__": unittest.main()