summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rw-r--r--test.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/test.py b/test.py
index eb79f4d..82df5b6 100644
--- a/test.py
+++ b/test.py
@@ -1,11 +1,11 @@
+from ebus.web import model
-import model
from sqlalchemy import create_engine
-#engine = create_engine('sqlite:///:memory:', echo=True)
-engine = create_engine("postgresql://yvesf:iii@10.2.2.13:5432/yvesf", echo=True)
+engine = create_engine('sqlite:///:memory:', echo=True)
+#engine = create_engine("postgresql://yvesf:iii@10.2.2.13:5432/yvesf", echo=True)
-model.Base.metadata.create_all(engine)
+model.ModelBase.metadata.create_all(engine)
from sqlalchemy.orm import sessionmaker
Session = sessionmaker()
@@ -17,14 +17,11 @@ session = Session()
t1_sensor = model.Sensor("foosensor", "blatest")
session.add(t1_sensor)
-t1_value1 = model.Value(t1_sensor, 0.5)
-session.add(t1_value1)
+for i in xrange(10000):
+ session.add( model.Value(t1_sensor, 0.5) )
session.commit()
-
-
-
session.close()