Mercurial Hosting > traffic-intelligence
diff 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 |
line wrap: on
line diff
--- a/python/tests/storage.txt Sat Jul 19 23:44:39 2014 -0400 +++ b/python/tests/storage.txt Mon Jul 21 16:17:22 2014 -0400 @@ -1,12 +1,31 @@ >>> from storage import * +>>> from StringIO import StringIO >>> f = openCheck('non_existant_file.txt') File non_existant_file.txt could not be opened. ->>> loadPrototypeMatchIndexesFromSqlite("nonexistent") +>>> nonexistentFilename = "nonexistent" +>>> loadPrototypeMatchIndexesFromSqlite(nonexistentFilename) DB Error: no such table: prototypes [] ->>> loadTrajectoriesFromSqlite("nonexistent", 'feature') +>>> loadTrajectoriesFromSqlite(nonexistentFilename, 'feature') DB Error: no such table: positions DB Error: no such table: velocities [] +>>> from os import remove +>>> remove(nonexistentFilename) + +>>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') +>>> readline(strio) +'sadlkfjsdlakjf' +>>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') +>>> readline(strio, ['#']) +'sadlkfjsdlakjf' +>>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') +>>> readline(strio, ['%']) +'# asdlfjasdlkj0' +>>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') +>>> readline(strio, '%*$') +'# asdlfjasdlkj0' +>>> readline(strio, '%#') +'sadlkfjsdlakjf'