def test_save_load_session(self): n.add_token("description") n.add_token("side", left="L", right="R", middle="M", default="M") n.add_token("type", animation="anim", control="ctrl", joint="jnt", default="ctrl") n.add_rule("test1", "description", "side", "type") n.add_rule("test2", "side", "description") n.set_active_rule("test1") repo = tempfile.mkdtemp() n.save_session(repo) n.flush_rules() n.flush_tokens() n.load_session(repo) self.assertTrue(n.has_token("description")) self.assertTrue(n.has_token("side")) self.assertTrue(n.has_token("type")) self.assertTrue(n.has_rule("test1")) self.assertTrue(n.has_rule("test2")) self.assertEqual(n.active_rule().name(), "test1")
def test_save_load_rule(self): n.add_rule("test", "description", "side", "type") filepath = tempfile.mktemp() n.save_rule("test", filepath) n.flush_rules() n.load_rule(filepath) self.assertTrue(n.has_rule("test"))
def setUp(self): n.flush_tokens() n.add_token("description") n.add_token("side", left="L", right="R", middle="M", default="M") n.add_token("type", animation="anim", control="ctrl", joint="jnt", default="ctrl") n.flush_rules() n.add_rule("test1", "description", "side", "type") n.add_rule("test2", "side", "description") n.set_active_rule("test1")
def setUp(self): n.flush_rules() n.flush_tokens()
def test_flush(self): result = n.flush_rules() self.assertTrue(result)
def setUp(self): n.flush_rules()