# Path: actionpotential.py
# SECS_PER_WEEK = 60 * 60 * 24 * 7
# PRODUCTION_MODE = not os.environ.get(
#     'SERVER_SOFTWARE', 'Development').startswith('Development')
# ROOT_DIRECTORY = os.path.dirname(__file__)
#       TEMPLATE_DIRECTORY = os.path.join(ROOT_DIRECTORY, 'src')
#       TEMPLATE_DIRECTORY = os.path.join(ROOT_DIRECTORY, 'dist')


from google.appengine.ext import db
from datetime import datetime
from google.appengine.ext import deferred
from base_test_case import BaseTestCase
from actionpotential import app as tst_app
        from decimal import Decimal
        from tools import toDecimal
import tools
import json
#!/usr/bin/python
# -*- coding: utf8 -*-


class UtilTestCase(BaseTestCase):

    def setUp(self):
        self.set_application(tst_app)
        self.setup_testbed()
        self.init_datastore_stub()
        self.init_memcache_stub()
        self.init_taskqueue_stub()
        self.register_search_api_stub()


    def testValidJson(self):
        volley=[
            {'json':"{}",'to_return':{}},
            {'json':'{"v":"1"}','to_return':{"v":"1"}},
            {'json':'{"v":"1"\r\n}','to_return':{"v":"1"}},
            {'json':'{"v":1}','to_return':{"v":1}},
            {'json':'"{}"','to_return':{}},
            {'json': "invalid", 'to_return': None},
            {'json': '[{"1":"one"}]', 'to_return': [{1:"one"}] }
        ]

        for v in volley:
            returned = tools.getJson(v['json'])
            self.assertEqual(json.dumps(returned),json.dumps(v['to_return']))


# Path: actionpotential.py
# SECS_PER_WEEK = 60 * 60 * 24 * 7
# PRODUCTION_MODE = not os.environ.get(
#     'SERVER_SOFTWARE', 'Development').startswith('Development')
# ROOT_DIRECTORY = os.path.dirname(__file__)
#       TEMPLATE_DIRECTORY = os.path.join(ROOT_DIRECTORY, 'src')
#       TEMPLATE_DIRECTORY = os.path.join(ROOT_DIRECTORY, 'dist')


# Path: testing/testing_util.py
from google.appengine.ext import db
from datetime import datetime
from google.appengine.ext import deferred
from base_test_case import BaseTestCase
from actionpotential import app as tst_app
        from decimal import Decimal
        from tools import toDecimal
import tools
import json

#!/usr/bin/python
# -*- coding: utf8 -*-


class UtilTestCase(BaseTestCase):

    def setUp(self):
        self.set_application(tst_app)
        self.setup_testbed()
        self.init_datastore_stub()
        self.init_memcache_stub()
        self.init_taskqueue_stub()
        self.register_search_api_stub()


    def testValidJson(self):
        volley=[
            {'json':"{}",'to_return':{}},
            {'json':'{"v":"1"}','to_return':{"v":"1"}},
            {'json':'{"v":"1"\r\n}','to_return':{"v":"1"}},
            {'json':'{"v":1}','to_return':{"v":1}},
            {'json':'"{}"','to_return':{}},
            {'json': "invalid", 'to_return': None},
            {'json': '[{"1":"one"}]', 'to_return': [{1:"one"}] }
        ]

        for v in volley:
            returned = tools.getJson(v['json'])
            self.assertEqual(json.dumps(returned),json.dumps(v['to_return']))


    def testSafeNum(self):