示例#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.