Commits

Ted Lawless  committed 3a1bc67

Changes to tests.py.

  • Participants
  • Parent commits f63d063

Comments (0)

Files changed (2)

 locations/sci*.html
 styles/*.css
 img/*.*
+fixtures/*.json
 book_locator\media\js\orwig.js
 book_locator\media\js\rock.js
 book_locator\media\js\scili.js

File book_locator/tests.py

-import unittest
+
 from django.test import TestCase
 from django.conf import settings
+from django.utils import simplejson
+import sys
+import unittest
 import urllib
 import urllib2
-import sys
-from django.utils import simplejson
 
+#Pull URL for testing from settings.  
 from settings_app import TEST_URL_BASE
 
 #These are local.  Change to match your library.
 
     def testSpeed(self):
         import settings_app
-        #base_url = settings_app.BASE_URL + '?callnumber=%s&location=%s'
         base_url = TEST_URL_BASE + 'book_locator/' + '?callnumber=%s&location=%s'
         for loc, call in test_set:
-	    print base_url
             this_url = base_url % (urllib.quote(call), urllib.quote(loc))
             print>>sys.stderr, this_url
             resp = urllib2.urlopen(this_url)
             resp_json = simplejson.load(resp)
             _k = "%s-%s" % (loc, call)
-            #print resp_json[_k]['located'], resp_json[_k]['elapsed']
             print>>sys.stderr, resp_json[_k]['located'], resp_json['elapsed']
-        #self.assertEquals(self.lion.speak(), 'The lion says "roar"')
-        #self.assertEquals(self.cat.speak(), 'The cat says "meow"')
         
 class locateTests(TestCase):
+    #Create a test fixture for your library and place in book_locator/fixtures. 
     fixtures = ['book_locator.json']
     
     
             bl_response = bl_response[_k]
             r_floor = bl_response['floor']
             r_aisle = bl_response['aisle'] + bl_response['side'].lower()
-            #r_side = bl_response['aisle'][-1].upper()
             self.assertEquals(r_floor.upper(), point.floor.upper())
             self.assertEquals(r_aisle, point.aisle.lower())
-            #self.assertEquals(r_side, point.side)