Package rubacon :: Package parsers :: Module test_information_parser
[hide private]
[frames] | no frames]

Source Code for Module rubacon.parsers.test_information_parser

 1  import os, sys 
 2  import marshal 
 3  from InformationParser import * 
 4  from ModelParser import * 
 5   
6 -class TestInfoParser(object):
7
8 - def test_info_parser(self):
9 """Test the information parser""" 10 ip = InformationParser() 11 res = ip.parse("sample/sample_info.xml") 12 assert (res['Role'][0]['rid'] == u'2') 13 assert (res['User'][0]['userName'] == u'name1') 14 assert (res['User'][0]['uid'] == u'1')
15
16 - def test_marshaling(self):
17 """The marshaling of info file""" 18 inf = open('data/db.information') 19 a = marshal.load(inf) 20 inf.close() 21 assert (a['Role'][0]['rid'] == u'2') 22 assert (a['User'][0]['userName'] == u'name1') 23 assert (a['User'][0]['uid'] == u'1')
24