5 from rtv_abstractpropertiesfile
import AbstractPropertiesFile
7 class PropertiesFile( AbstractPropertiesFile
):
9 def set_value( self
, key
, value
):
10 self
.__dict
__[key
] = value
12 def get_value( self
, key
):
14 if key
in self
.__dict
__:
15 ret
= self
.__dict
__[key
]
19 return self
.__dict
__.keys()
26 pf
.mystrpipe
= "|Hello"
27 pf
.mytuple
= ( "x", "y", "z" )
28 pf
.mylist
= [ "xa", "yb", "zc" ]
32 pf
.mystrbool
= "False"
34 filename
= "tmp.rtvtestpropertiesfile"
38 pf2
= PropertiesFile()
43 # Convert pf's tuple value to a list before comparison -
44 # we convert every sequence type to a list
45 pf
.mytuple
= list( pf
.mytuple
)
47 assert( pf
.__dict
__ == pf2
.__dict__
)
49 # TODO: test reading a file with spaces around the =, etc.