<commit_before>#!/usr/bin/env python
# -*- coding: utf8 -*-
import os
from burpui import app, bui
import unittest
import urllib2
import pprint
from flask.ext.testing import LiveServerTestCase, TestCase

class BurpuiLiveTestCase(LiveServerTestCase):

	def create_app(self):
		conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'burpui.cfg')
		app.config['TESTING'] = True
		app.config['LIVESERVER_PORT'] = 5001
		app.config['CFG'] = conf
		bui.setup(conf)
		return 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):
		app.config['TESTING'] = True
		bui.burpport = 9999
		return app

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

<commit_msg>fix unit test since refactoring<commit_after>#!/usr/bin/env python
# -*- coding: utf8 -*-
import os
from burpui import app, bui
import unittest
import urllib2
import pprint
from flask.ext.testing import LiveServerTestCase, TestCase

class BurpuiLiveTestCase(LiveServerTestCase):

	def create_app(self):
		conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'burpui.cfg')
		app.config['TESTING'] = True
		app.config['LIVESERVER_PORT'] = 5001
		app.config['CFG'] = conf
		bui.setup(conf)
		return app

	def setUp(self):
		print '\nBegin Test 1\n'

	def tearDown(self):
		print '\nTest 1 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 setUp(self):
		print '\nBegin Test 2\n'

	def tearDown(self):
		print '\nTest 2 Finished!\n'

	def create_app(self):
		app.config['TESTING'] = True
		bui.cli.port = 9999
		return app

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


{'fraction_non_alphanumeric': 0.13443740867023868, 'fraction_numerical': 0.015586945932781296, 'mean_word_length': 4.868571428571428, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5725429', 'n_tokens_mistral': 807, 'n_tokens_neox': 737, 'n_words': 155}