Example #1
0
 def test_requests_with_additional_keyword_arguments(self):
     t = Three("api.city.gov")
     t.requests("123", status="open")
     params = {"service_code": "123", "status": "open"}
     expected = "https://api.city.gov/requests.json"
     req.get.assert_called_with(expected, params=params)
Example #2
0
 def test_empty_requests_call(self):
     t = Three("api.city.gov")
     t.requests()
     expected = "https://api.city.gov/requests.json"
     req.get.assert_called_with(expected, params={})
Example #3
0
 def test_requests_with_additional_keyword_arguments(self):
     t = Three('api.city.gov')
     t.requests('123', status='open')
     params = {'service_code': '123', 'status': 'open'}
     expected = 'https://api.city.gov/requests.json'
     t.session.get.assert_called_with(expected, params=params)
Example #4
0
 def test_requests_call_with_service_code(self):
     t = Three("api.city.gov")
     t.requests("123")
     params = {"service_code": "123"}
     expected = "https://api.city.gov/requests.json"
     req.get.assert_called_with(expected, params=params)
Example #5
0
 def test_empty_requests_call(self):
     t = Three('api.city.gov')
     t.requests()
     expected = 'https://api.city.gov/requests.json'
     t.session.get.assert_called_with(expected, params={})
Example #6
0
 def test_requests_call_with_service_code(self):
     t = Three('api.city.gov')
     t.requests('123')
     params = {'service_code': '123'}
     expected = 'https://api.city.gov/requests.json'
     t.session.get.assert_called_with(expected, params=params)
Example #7
0
 def test_requests_with_additional_keyword_arguments(self):
     t = Three('api.city.gov')
     t.requests('123', status='open')
     params = {'service_code': '123', 'status': 'open'}
     expected = 'https://api.city.gov/requests.json'
     t.session.get.assert_called_with(expected, params=params)
Example #8
0
 def test_requests_call_with_service_code(self):
     t = Three('api.city.gov')
     t.requests('123')
     params = {'service_code': '123'}
     expected = 'https://api.city.gov/requests.json'
     t.session.get.assert_called_with(expected, params=params)
Example #9
0
 def test_empty_requests_call(self):
     t = Three('api.city.gov')
     t.requests()
     expected = 'https://api.city.gov/requests.json'
     t.session.get.assert_called_with(expected, params={})
def getOpen311Requests(since,until):
    t = Three(open311URL, ssl_version=ssl.PROTOCOL_TLSv1)
    start = since is not None and '%02d-%02d-%02d' %(since.month,since.day,since.year) or None
    end = until is not None and '%02d-%02d-%02d' %(until.month,until.day,until.year) or None
    return t.requests(start=start,end=end,extensions=True)
def getOpen311Request(requestId):
    t = Three(open311URL, ssl_version=ssl.PROTOCOL_TLSv1)
    a= t.requests(service_request_id=requestId)
    return a