コード例 #1
0
 def setUp(self):
     xml_service_request = """<?xml version="1.0" encoding="utf-8"?>
     <service_requests>
         <request>
             <service_request_id>638344</service_request_id>
             <status>closed</status>
             <status_notes>Duplicate request.</status_notes>
             <service_name>Sidewalk and Curb Issues</service_name>
             <service_code>006</service_code>
             <description></description>
             <agency_responsible></agency_responsible>
             <service_notice></service_notice>
             <requested_datetime>2010-04-14T06:37:38-08:00</requested_datetime>
             <updated_datetime>2010-04-14T06:37:38-08:00</updated_datetime>
             <expected_datetime>2010-04-15T06:37:38-08:00</expected_datetime>
             <address>8TH AVE and JUDAH ST</address>
             <address_id>545483</address_id>
             <zipcode>94122</zipcode>
             <lat>37.762221815</lat>
             <long>-122.4651145</long>
             <media_url>http://open311.city.gov.s3.amazonaws.com/requests/media/638344.rss </media_url>
         </request>
     </service_requests>"""
     api.urlopen = Mock()
     api.urlopen().read.return_value = xml_service_request
コード例 #2
0
 def setUp(self):
     xml_service_definition = """<?xml version="1.0" encoding="utf-8"?>
     <service_definition>
         <service_code>033</service_code>	
         <attributes>
             <attribute>
                 <variable>true</variable>
                 <code>WHISHETN</code>
                 <datatype>singlevaluelist</datatype>
                 <required>true</required>
                 <datatype_description></datatype_description>		
                 <order>1</order>	
                 <description>What is the ticket/tag/DL number?</description>
                 <values>
                     <value>
                         <key>123</key>
                         <name>Ford</name>
                     </value>
                     <value>
                         <key>124</key>
                         <name>Chrysler</name>
                     </value>			
                 </values>
             </attribute>	
         </attributes>
     </service_definition>"""
     api.urlopen = Mock()
     api.urlopen().read.return_value = xml_service_definition
コード例 #3
0
 def setUp(self):
     xml_service_request = """<?xml version="1.0" encoding="utf-8"?>
     <service_requests>
         <request>
             <service_request_id>638344</service_request_id>
             <token>123456</token>
         </request>
     </service_requests>"""
     api.urlopen = Mock()
     api.urlopen().read.return_value = xml_service_request
コード例 #4
0
 def setUp(self):
     xml_service_requests = """<?xml version="1.0" encoding="utf-8"?>
     <service_requests>
         <request>
             <service_request_id>293944</service_request_id>
             <service_notice>
                 The City will inspect and require the responsible party to
                 correct within 24 hours and/or issue a Correction Notice
                 or Notice of Violation of the Public Works Code
             </service_notice>
             <account_id/>
         </request>
     </service_requests>"""
     api.urlopen = Mock()
     api.urlopen().read.return_value = xml_service_requests
コード例 #5
0
 def setUp(self):
     xml_services = """<?xml version="1.0" encoding="utf-8"?>
     <services>
         <service>
             <service_code>001</service_code>
             <service_name>Cans left out 24x7</service_name>
             <description>
                 Garbage or recycling cans that have been left out for more
                 than 24 hours after collection. Violators will be cited.
             </description>
             <metadata>true</metadata>
             <type>realtime</type>
             <keywords>lorem, ipsum, dolor</keywords>
             <group>sanitation</group>
         </service>
         <service>
             <service_code>002</service_code>
             <metadata>true</metadata>
             <type>realtime</type>
             <keywords>lorem, ipsum, dolor</keywords>
             <group>street</group>
             <service_name>Construction plate shifted</service_name>
             <description>
                 Metal construction plate covering the street or sidewalk
                 has been moved.
             </description>
         </service>
         <service>
             <service_code>003</service_code>
             <metadata>true</metadata>
             <type>realtime</type>
             <keywords>lorem, ipsum, dolor</keywords>
             <group>street</group>
             <service_name>Curb or curb ramp defect</service_name>
             <description>
                 Sidewalk curb or ramp has problems such as cracking,
                 missing pieces, holes, and/or chipped curb.
             </description>
         </service>
     </services>"""
     api.urlopen = Mock()
     api.urlopen().read.return_value = xml_services