#import unittest
from server.forecasting.forecasting.weather import WeatherForecast
from django.test import TestCase
from server.models import Sensor, Device

''''class ForecastingTest(unittest.TestCase):
	def test_test(self):
		cast = WeatherForecast()
'''
class ForecastingDBTest(TestCase):
	def test_if_weather_sources_in_db(self):
		source = Device.objects.get(name='Internet')
		sensors = Sensor.objects.filter(device=source)
		assertGreater(len(sensor), 0)
		
	def test_crawled_data_in_data(self):
		pass



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

@@ -150,16 +150,29 @@
 , Device
+, SensorValue
 %0A%0A''''cl
@@ -203,33 +203,36 @@
 test.TestCase):%0A
-%09
+    
 def test_test(se
@@ -236,18 +236,24 @@
 (self):%0A
-%09%09
+        
 cast = W
@@ -308,17 +308,20 @@
 tCase):%0A
-%09
+    
 def test
@@ -357,64 +357,367 @@
 f):%0A
-%09%09source = Device.objects.get(name='Internet')%0A%09%09
+        '''In the database should at least exist one weather source.'''%0A        try:%0A            sources = WeatherSource.objects.all()%0A        except NameError:%0A            self.fail('No weather source found.')%0A    def test_crawled_data_in_data(self):%0A        pass%0A        '''net = Device(name='File', device_type=Device.NET)%0A        net.save()%0A        
 sensor
-s
  = S
@@ -725,118 +725,400 @@
 nsor
-.objects.filter(device=source)%0A%09%09assertGr
+(device=net, name='Weather Forecast',%0A                       key='testresource', unit='C', value_type=Sensor.FLOAT)%0A        sensor.save()%0A        forecast = W
 eat
+h
 er
-(len(sensor), 0)%0A%09%09%0A%09def test_
+Forecast()%0A        forecast.get_weather_forecast()%0A        print forecast.get_weather_forecast()%0A        # start crawling of a static resource%0A        # ask fpor the 
 crawled
-_
+ 
 data
-_in_data(self):%0A%09%09pass
+%0A        #SensorValue.objects.filter()%0A        '''
 %0A%0A%0A%0A

change test for weather source in db.