示例#1
0
    def test_to_file(self):
        p1 = Preset()
        s1 = State()
        s1['Power'] = 'On'
        s1['Position'] = (1,0)
        p1['cam1'] = s1
        p1.toFile('tmp.preset')
        p2 = Preset('tmp.preset')
        os.remove('tmp.preset')

        assert p1 == p2
示例#2
0
 def test_preset_1(self):
     p1 = Preset('data' + os.sep + 'sample.preset')
     assert p1.getNames() is not None