Esempio n. 1
0
	def setUp(self):
		self.freewebnode = FreeWebNode()
		self.freewebnode.loadFriendList()
		self.freewebnode.loadRules()
Esempio n. 2
0
class TestFreeWebNode(unittest.TestCase):

	def setUp(self):
		self.freewebnode = FreeWebNode()
		self.freewebnode.loadFriendList()
		self.freewebnode.loadRules()

	def test_loadFriendList(self):
		self.freewebnode.loadFriendList()
		self.assertIsNotNone(self.freewebnode.friendList)

	def test_loadRules(self):
		self.freewebnode.loadRules()
		self.assertIsNotNone(self.freewebnode.rules)

	def test_checkAllFriendRequests(self):
		self.freewebnode.checkAllFriendRequests()

	def test_checkRequestPage(self):
		friend = {'name': 'Bob', 'key': '12345'}
		self.freewebnode.checkRequestPage(friend)

	def test_checkRules(self):
		allowed = self.freewebnode.checkRules('Bob', 'http://en.wikipedia.org/')
		self.assertFalse(allowed)

	def test_fulfillRequest(self):
		self.freewebnode.fulfillRequest('http://en.wikipedia.org/')

	def tearDown(self):
		pass