def test_site_list_urls(self):
        locations = xmlparsing.site_list_urls('testfiles/sitelistpartial.xml')
        assert locations[u'Pointe-à-la-Croix'] == ('QC', 's0000810')

        locations = xmlparsing.site_list_urls('testfiles/sitelist.xml')
        assert locations['Toronto Island'][0] == 'ON'
        assert locations['Toronto Island'][1] == 's0000785'
 def test_db_add_locations(self):
     locations = xmlparsing.site_list_urls('testfiles/sitelist.xml')
     f = open('testfiles/sitecodesdict.txt', 'w')
     f.write(str(locations))
     xmlparsing.db_add_locations(redis.test, locations)
     codes = redis.test.get('site_codes')
     f = open('testfiles/sitecodesdict.txt', 'r')
     # a failure here may just indicate that the codes have changed
     assert codes == f.read()
     codesDict = ast.literal_eval(codes)
     loc = u'Rivière-du-Loup'
     assert codesDict[loc] == ('QC', 's0000253')
     loc = u'Îles-de-la-Madeleine'
     assert codesDict[loc] == ('QC', 's0000174')