Commits

sammyrulez committed f2c101d

started part three

  • Participants
  • Parent commits a118666

Comments (0)

Files changed (2)

 import unittest
 from weather.temp_spread import TemperatureSpread
 from soccer.goals_spread import GoalSpread
+from kutil import dry
 
 
 
 class TestWeather(unittest.TestCase):
-	def test_load_file(self):
-		t_spread = TemperatureSpread()
-		t_spread.load_file()
+
 		
 	def test_spread(self):
 		t_spread = TemperatureSpread()
 		self.assertTrue(goals_min_diff)
 		self.assertTrue(goals_min_diff > 0)
 		
+class TestDry(unittest.TestCase):
+	
+	def test_load_file(self):
+		file = dry.load_file('./data/weather.dat')
+		self.assertTrue(file)
+		
+		
+		
 		
 		
 	

File weather/temp_spread.py

 import math
 
+from kutil import dry
+
 
 class TemperatureSpread:
 
 		self.min_spread = None
 		self.min_spread_day = None
 		
-	def load_file(self):
-		print 
-		return open('./data/weather.dat','r')
 		
 	def eval_line(self, line):
 		row = line.split()
 			pass
 	
 	def eval_spread(self):
-		file = self.load_file()
+		file = dry.load_file('./data/weather.dat')
 		for line in file:
 			self.eval_line(line)
 		return self.min_spread