view test/test_sub.py @ 1438:594160be47f1

device control page now saves new effects and can clear itself Ignore-this: 5166c8f19d3e399e15c1189d3c7e5a70
author drewp@bigasterisk.com
date Sat, 11 Jun 2016 21:03:45 +0000
parents b94abe02eefc
children
line wrap: on
line source

import os
from light9.Submaster import Submaster

def testCalc():
    dest = "/home/drewp/projects/light9/show/dance2007/subs/sub"
    try:
        os.remove(dest)
    except OSError:
        pass
    
    sub = Submaster('sub', {'front1' : .5, 'front2' : .7})
    assert not sub.no_nonzero()
    assert sub.get_dmx_list()
    sub.save()
    
    assert os.path.exists(dest)

    sub2 = Submaster('sub')
    sub2.reload()
    assert sub == sub2
    assert sub2.get_levels() == {'front1' : .5, 'front2' : .7}