import os
import burpui
import unittest
import urllib2
import pprint
from flask.ext.testing import LiveServerTestCase, TestCase

class BurpuiLiveTestCase(LiveServerTestCase):

	def create_app(self):
		burpui.app.config['TESTING'] = True
		burpui.app.config['LIVESERVER_PORT'] = 5001
		burpui.init()
		return burpui.app

#	def setUp(self):

#	def tearDown(self):
#		print 'Test Finished!\n'

	def test_server_is_up_and_running(self):
		response = urllib2.urlopen(self.get_server_url())
		self.assertEqual(response.code, 200)

class BurpuiTestCase(TestCase):

	def create_app(self):
		burpui.app.config['TESTING'] = True
		burpui.burpport = 9999
		return burpui.app

	def test_some_json(self):
		response = self.client.get('/api/clients.json')
		self.assertEquals(response.json, dict(results=[]))


if __name__ == '__main__':
	unittest.main()

@@ -7,19 +7,33 @@
  os%0A
+from burpui 
 import 
-burp
+app, b
 ui%0Ai
@@ -200,39 +200,32 @@
 te_app(self):%0A%09%09
-burpui.
 app.config%5B'TEST
@@ -239,23 +239,16 @@
  True%0A%09%09
-burpui.
 app.conf
@@ -284,18 +284,94 @@
 %09%09bu
-rpui.init(
+i.setup(conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'burpui.cfg')
 )%0A%09%09
@@ -373,31 +373,24 @@
 ))%0A%09%09return 
-burpui.
 app%0A%0A#%09def s
@@ -645,23 +645,16 @@
 elf):%0A%09%09
-burpui.
 app.conf
@@ -678,19 +678,16 @@
 rue%0A%09%09bu
-rpu
 i.burppo
@@ -705,23 +705,16 @@
 %09return 
-burpui.
 app%0A%0A%09de

update unit test