HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
ftests_dbi_fetch.py
Go to the documentation of this file.
1 """
2 HCE project, Python bindings, Distributed Tasks Manager application.
3 Event objects definitions.
4 
5 @package: dtm
6 @file dbi.py
7 @author Oleksii <developers.hce@gmail.com>
8 @link: http://hierarchical-cluster-engine.com/
9 @copyright: Copyright &copy; 2013-2014 IOIX Ukraine
10 @license: http://hierarchical-cluster-engine.com/license/
11 @since: 0.1
12 """
13 
14 
15 """
16 used in:
17 ./hce/dtm/Scheduler.py
18 ./hce/dtm/TasksManager.py
19 ./hce/dtm/TasksDataManager.py
20 """
21 
22 from dbi.dbi import DBI
23 from dtm.TaskLogScheme import TaskLogScheme
24 from dtm.TaskLog import TaskLog
25 
26 
27 def run_test():
28  config_dic = {"db_name":"sqlite:///:memory:"}
29  dbi = DBI(config_dic)
30  tl = TaskLog()
31  tls1 = TaskLogScheme(tl)
32  tls1.id = 11
33  tls2 = TaskLogScheme(tl)
34  tls2.id = 11
35  dbi.insert(tls1)
36  dbi.insert(tls2)
37  obj = dbi.fetch(tls1, "id=11")
38  print obj
39  if len(obj)!=2:
40  print "BAD"
41  else:
42  print"OK"
43  return
44 
45 
46 
47 if __name__ == "__main__":
48 
49  run_test()
Class describes structures of task item used in TaskManager.
Definition: TaskLog.py:10
Definition: dbi.py:1