def test_save_new_data(self): saved_name = tpl_dir + 'generate.smtpl' t1 = Template() b1 = Block.from_itemname('Activation Module') b2 = Block(409, posy=1) t1.connect_blocks(b1, b2) t1.add(b1) t1.add(b2) t1.save(saved_name) t2 = Template.fromSMTPL(saved_name) os.remove(saved_name) assert t1.num_blocks() == t2.num_blocks() assert t1.num_connections() == t2.num_connections()
def test_make_connections(self): t = Template() t.add(Block(5)) t.add(Block(5, posy=1)) t.connect_blocks_at((0, 0, 0), (0, 1, 0)) assert t.num_connections() == 1