예제 #1
0
파일: test.py 프로젝트: siruguri/three
 def test_three_dev_functionality(self):
     three.dev("http://api.city.gov")
     environ = os.environ["OPEN311_CITY_INFO"]
     expected = '{"endpoint": "http://api.city.gov"}'
     self.assertEqual(environ, expected)
예제 #2
0
파일: test.py 프로젝트: siruguri/three
 def test_three_dev_keyword_arguments(self):
     three.dev("http://api.city.gov", format="xml")
     environ = os.environ["OPEN311_CITY_INFO"]
     expected = '{"endpoint": "http://api.city.gov", "format": "xml"}'
     self.assertEqual(environ, expected)
예제 #3
0
"""SMSified logic for the MTA application."""

import os
import requests as req
import three


if 'PRODUCTION_ENV' in os.environ:
    # Then we'll use the actual SeeClickFix endpoint.
    macon = three.city('macon')
else:
    # Otherwise, it's testing.
    macon = three.dev('http://seeclicktest.com/open311/v2')


class AddressError(Exception):
    """Can't parse an address from a text message."""
    pass


class AuthenticationError(Exception):
    """
    Error should be raised when the SMSified username and password
    aren't known.
    """
    pass


def auth():
    """
    Get SMSified username and password authentication from environment
예제 #4
0
파일: test.py 프로젝트: isabella232/three
 def test_three_dev_keyword_arguments(self):
     three.dev('http://api.city.gov', format='xml')
     environ = json.loads(os.environ['OPEN311_CITY_INFO'])
     expected = {"endpoint": "http://api.city.gov", "format": "xml"}
     self.assertEqual(environ, expected)
예제 #5
0
파일: test.py 프로젝트: isabella232/three
 def test_three_dev_functionality(self):
     three.dev('http://api.city.gov')
     environ = os.environ['OPEN311_CITY_INFO']
     expected = '{"endpoint": "http://api.city.gov"}'
     self.assertEqual(environ, expected)
예제 #6
0
 def test_three_dev_keyword_arguments(self):
     three.dev('http://api.city.gov', format='xml')
     environ = json.loads(os.environ['OPEN311_CITY_INFO'])
     expected = {"endpoint": "http://api.city.gov", "format": "xml"}
     self.assertEqual(environ, expected)
예제 #7
0
"""SMSified logic for the MTA application."""

import os
import requests as req
import three

if 'PRODUCTION_ENV' in os.environ:
    # Then we'll use the actual SeeClickFix endpoint.
    macon = three.city('macon')
else:
    # Otherwise, it's testing.
    macon = three.dev('http://seeclicktest.com/open311/v2')


class AddressError(Exception):
    """Can't parse an address from a text message."""
    pass


class AuthenticationError(Exception):
    """
    Error should be raised when the SMSified username and password
    aren't known.
    """
    pass


def auth():
    """
    Get SMSified username and password authentication from environment
    variables.