Mercurial Hosting > traffic-intelligence
comparison python/tests/storage.txt @ 564:36605d843be5
modified bug for reading vissim files, cleaned use of readline with multiple type of characters for comments (to ignore)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 21 Jul 2014 16:17:22 -0400 |
parents | bce1fe45d1b2 |
children | ef6dd60be2e1 |
comparison
equal
deleted
inserted
replaced
563:39de5c532559 | 564:36605d843be5 |
---|---|
1 >>> from storage import * | 1 >>> from storage import * |
2 >>> from StringIO import StringIO | |
2 | 3 |
3 >>> f = openCheck('non_existant_file.txt') | 4 >>> f = openCheck('non_existant_file.txt') |
4 File non_existant_file.txt could not be opened. | 5 File non_existant_file.txt could not be opened. |
5 | 6 |
6 >>> loadPrototypeMatchIndexesFromSqlite("nonexistent") | 7 >>> nonexistentFilename = "nonexistent" |
8 >>> loadPrototypeMatchIndexesFromSqlite(nonexistentFilename) | |
7 DB Error: no such table: prototypes | 9 DB Error: no such table: prototypes |
8 [] | 10 [] |
9 >>> loadTrajectoriesFromSqlite("nonexistent", 'feature') | 11 >>> loadTrajectoriesFromSqlite(nonexistentFilename, 'feature') |
10 DB Error: no such table: positions | 12 DB Error: no such table: positions |
11 DB Error: no such table: velocities | 13 DB Error: no such table: velocities |
12 [] | 14 [] |
15 >>> from os import remove | |
16 >>> remove(nonexistentFilename) | |
17 | |
18 >>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') | |
19 >>> readline(strio) | |
20 'sadlkfjsdlakjf' | |
21 >>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') | |
22 >>> readline(strio, ['#']) | |
23 'sadlkfjsdlakjf' | |
24 >>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') | |
25 >>> readline(strio, ['%']) | |
26 '# asdlfjasdlkj0' | |
27 >>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') | |
28 >>> readline(strio, '%*$') | |
29 '# asdlfjasdlkj0' | |
30 >>> readline(strio, '%#') | |
31 'sadlkfjsdlakjf' |