Beispiel #1
0
	def test_drop(self):
		"""Testing the Implementation of a Stock Value Dropping
			The funtion test_drop checks the original stock price to
			new raised stock price if it is incresed it passes otherwise fail.
		"""
		stk = Stock(None, None, None, None, None, None, None)
		stk.StockPrice = 120
		orig_stk_value = stk.StockPrice
		drop(stk)
		print 'Testing: ' + str(stk.StockPrice) + ' < ' + str(orig_stk_value)
		self.assertLess(stk.StockPrice, orig_stk_value)
Beispiel #2
0
	def test_fluctuate(self):
		"""Testing the Implementation of a Stock Value Fluctuating
			The function test_fluctuate implements a change in the stock value
			by either rising, dropping, or even remaining consistent.
		"""
		stk = Stock(None, None, None, None, None, None, None)
		stk.StockPrice = 120
		orig_stk_value = stk.StockPrice
		for x in xrange(1,70):
			#orig_stk_value = stk.StockPrice can't have or else if it goes in prime or other it does actually test correctly
			fluctuate(stk)
		self.assertNotEqual(stk.StockPrice, orig_stk_value)
Beispiel #3
0
	def test_init(self):
		"""Testing the Initialization of a Stock Value"""
		stk = Stock(None, None, None, None, None, None, None)
		print stk.StockPrice
		try:
			self.assertEqual(stk.StockPrice, 0.0)
		except ValueError:
			print 'Failed: Stock Initialization not equivalent to 0.0'