Ejemplo n.º 1
0
import config_cloud as cfg
from core.pg.datatypes import Text, Point, Float, Integer

from common import tilecalc

target = "rest"

if target == "local":
    import core.cloud as cc

    cloud = cc.Cloud(cfg.user)
elif target == "rest":
    sys.path.append("../client")
    import pyclient as cc

    cloud = cc.connect("http://*****:*****@unittest.skip('skip')
class TestPoints(unittest.TestCase):
    """Test the geographic functionality."""

    def setUp(self):
        """Create the database, table and insert some values."""
        try:
            self.db = cloud.create_database("geodb")
        except (cc.RelationExists, cc.IntegrityError):
            cloud.Database("geodb").drop()
            self.db = cloud.create_database("geodb")

        cols = [
            {"name": "home", "datatype": Text},
Ejemplo n.º 2
0
import unittest, time, datetime
import sys
sys.path.append('../')

import config_cloud as cfg
from core.pg.datatypes import Text, Integer

target = 'rest'

if target == 'local':
    import core.cloud as cc
    cloud = cc.Cloud(cfg.user)
elif target == 'rest':
    sys.path.append('../client')
    import pyclient as cc
    cloud = cc.connect("http://localhost:5000", cfg.user)


class TestConstraints(unittest.TestCase):
    """Test column restraint creation and enforcement."""
    def setUp(self):
        """Create the database, table and columns."""
        try:
            self.db = cloud.create_database('constraints')
        except:
            cloud.Database('constraints').drop()
            self.db = cloud.create_database('constraints')
        cols = [{
            'name': 'pk',
            'datatype': Text
        }, {