示例#1
0
    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")
示例#2
0
    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"))
示例#3
0
    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"))
示例#4
0
    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")
示例#5
0
    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")
示例#6
0
    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")
示例#7
0
 def setUp(self):
     n.flush_rules()
     n.flush_tokens()
示例#8
0
 def test_flush(self):
     result = n.flush_rules()
     self.assertTrue(result)
示例#9
0
 def setUp(self):
     n.flush_rules()
示例#10
0
 def setUp(self):
     n.flush_rules()
     n.flush_tokens()
示例#11
0
 def test_flush(self):
     result = n.flush_rules()
     self.assertTrue(result)
示例#12
0
 def setUp(self):
     n.flush_rules()