• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python simpleTests.test_evaluation函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中test.testsTriggersExpressions.simpleTests.test_evaluation函数的典型用法代码示例。如果您正苦于以下问题:Python test_evaluation函数的具体用法?Python test_evaluation怎么用?Python test_evaluation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了test_evaluation函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: eval_false

    def eval_false(self, previousEvaluation, b1, b2):
        lit1 = BLitteral(b1)
        lit2 = BLitteral(b2)
        token = None
        trig = And(lit1, lit2)

        simpleTests.test_evaluation(self, trig, previousEvaluation, token)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testAnd.py


示例2: eval_true

    def eval_true(self, previousEvaluation):
        lit1 = BLitteral(True)
        lit2 = BLitteral(True)
        token = None
        trig = And(lit1, lit2)

        simpleTests.test_evaluation(self, trig, previousEvaluation, token, previousEvaluation)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testAnd.py


示例3: succeed_randInt_with_unevaluated_variable_result

    def succeed_randInt_with_unevaluated_variable_result(self, previousEvaluation):
        import random

        random.seed(0)
        maxInt = ALitteral(3)

        evaluation = previousEvaluation.copy()
        evaluation[Variable('J')] = 2
        trig = RandInt(Variable('J'), maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None, evaluation)

        evaluation[Variable('J')] = 2
        trig = RandInt(Variable('J'), maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None, evaluation)

        evaluation[Variable('J')] = 1
        trig = RandInt(Variable('J'), maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None, evaluation)

        evaluation[Variable('J')] = 0
        trig = RandInt(Variable('J'), maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None, evaluation)

        evaluation[Variable('J')] = 1
        trig = RandInt(Variable('J'), maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None, evaluation)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:26,代码来源:testRandInt.py


示例4: eval_false

    def eval_false(self, previousEvaluation):
        lit1 = BLitteral(False)
        lit2 = BLitteral(False)
        token = None
        trig = Or(lit1, lit2)

        simpleTests.test_evaluation(self, trig, previousEvaluation, token)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testOr.py


示例5: timer_when_token_did_not_wait_enough

    def timer_when_token_did_not_wait_enough(self, previousEvaluation):
        trig = Timer(ALitteral(30))
        token = Token(None, [], {})

        for i in xrange(30):
            simpleTests.test_evaluation(self, trig, previousEvaluation, token)
            token.oneMoreFrame()
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testTimer.py


示例6: is_with_empty_previous_evaluation

    def is_with_empty_previous_evaluation(self, isValue):
        trig = Is(Variable('X'), ALitteral(isValue))

        evaluation = Evaluation()
        evaluation[Variable('X')] = isValue

        simpleTests.test_evaluation(self, trig, self.eval1, None, evaluation)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testIs.py


示例7: test_succeed_randInt_with_variable_expected_result

    def test_succeed_randInt_with_variable_expected_result(self):
        import random

        random.seed(0)
        maxInt = ALitteral(3)

        previousEvaluation = self.eval2
        expected_result = Variable('X')

        self.eval2[Variable('X')] = 2
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None, previousEvaluation)

        self.eval2[Variable('X')] = 2
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None, previousEvaluation)

        self.eval2[Variable('X')] = 1
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None, previousEvaluation)

        self.eval2[Variable('X')] = 0
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None, previousEvaluation)

        self.eval2[Variable('X')] = 1
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None, previousEvaluation)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:28,代码来源:testRandInt.py


示例8: failed_randInt_with_constant_expected_result

    def failed_randInt_with_constant_expected_result(self, previousEvaluation):
        import random

        random.seed(0)
        maxInt = ALitteral(3)

        expected_result = ALitteral(1)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None)

        expected_result = ALitteral(0)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None)

        expected_result = ALitteral(2)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None)

        expected_result = ALitteral(2)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None)

        expected_result = ALitteral(0)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:25,代码来源:testRandInt.py


示例9: test_randInd_maxInt_with_variable_expected_result_must_be_positive

    def test_randInd_maxInt_with_variable_expected_result_must_be_positive(self):
        maxInt = ALitteral(-2)
        import random
        random.seed(0)

        expected_result = Variable('X')

        self.eval2[Variable('X')] = ALitteral(2)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, self.eval2, None)

        self.eval2[Variable('X')] = ALitteral(2)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, self.eval2, None)

        self.eval2[Variable('X')] = ALitteral(1)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, self.eval2, None)

        self.eval2[Variable('X')] = ALitteral(0)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, self.eval2, None)

        self.eval2[Variable('X')] = ALitteral(1)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, self.eval2, None)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:26,代码来源:testRandInt.py


示例10: is_true_with_non_empty_previous_evaluation_1

    def is_true_with_non_empty_previous_evaluation_1(self, isValue):
        trig = Is(Variable('X'), ALitteral(isValue))

        evaluation = Evaluation()
        evaluation[Variable('X')] = isValue
        evaluation[Variable('Y')] = 'abc'
        evaluation[Variable('Z')] = 12.0
        evaluation[Variable('T')] = True

        simpleTests.test_evaluation(self, trig, self.eval2, None, evaluation)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:10,代码来源:testIs.py


示例11: rand_false

    def rand_false(self, previousEvaluation):
        rand = Rand(ALitteral(0.5))
        import random
        random.seed(0)

        simpleTests.test_evaluation(self, rand, previousEvaluation, None)
        simpleTests.test_evaluation(self, rand, previousEvaluation, None)
        random.random()
        random.random()
        simpleTests.test_evaluation(self, rand, previousEvaluation, None)
        random.random()
        simpleTests.test_evaluation(self, rand, previousEvaluation, None)
        random.random()
        random.random()
        simpleTests.test_evaluation(self, rand, previousEvaluation, None)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:15,代码来源:testRand.py


示例12: randInd_maxInt_with_constant_expected_result_must_be_positive

    def randInd_maxInt_with_constant_expected_result_must_be_positive(self, previousEvaluation):
        maxInt = ALitteral(-2)
        import random

        random.seed(0)
        expected_result = ALitteral(2)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None)

        expected_result = ALitteral(2)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None)

        expected_result = ALitteral(1)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None)

        expected_result = ALitteral(0)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None)

        expected_result = ALitteral(1)
        trig = RandInt(expected_result, maxInt)
        simpleTests.test_evaluation(self, trig, previousEvaluation, None)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:24,代码来源:testRandInt.py


示例13: test_success_two_kwargs_3

 def test_success_two_kwargs_3(self):
     trig = PropertyTriggerExpression('ETwoKW', [], {ALitteral(1): ALitteral(12), ALitteral('def'): ALitteral(12)})
     token = None
     simpleTests.test_evaluation(self, trig, self.eval2, token, self.eval2)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:4,代码来源:testPropertyStaticParameters.py


示例14: test_success_kwargs_string_string

 def test_success_kwargs_string_string(self):
     trig = PropertyTriggerExpression('ESS', [], {ALitteral('abc'): ALitteral('def')})
     token = None
     simpleTests.test_evaluation(self, trig, self.eval2, token, self.eval2)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:4,代码来源:testPropertyStaticParameters.py


示例15: test_success_kwargs_float_float

 def test_success_kwargs_float_float(self):
     trig = PropertyTriggerExpression('EFF', [], {ALitteral(sqrt(2)): ALitteral(pi)})
     token = None
     simpleTests.test_evaluation(self, trig, self.eval2, token, self.eval2)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:4,代码来源:testPropertyStaticParameters.py


示例16: test_fail_too_many_kwargs

 def test_fail_too_many_kwargs(self):
     trig = PropertyTriggerExpression('EII', [], {ALitteral(1): ALitteral(12), ALitteral(2): ALitteral(24)})
     token = None
     simpleTests.test_evaluation(self, trig, self.eval2, token)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:4,代码来源:testPropertyStaticParameters.py


示例17: test_rand_one_with_empty_previous_evaluation

 def test_rand_one_with_empty_previous_evaluation(self):
     rand = Rand(ALitteral(1.0))
     for i in xrange(100):
         simpleTests.test_evaluation(self, rand, self.eval1, None, self.eval1)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:4,代码来源:testRand.py


示例18: test_fail_wrong_name_1_with_non_empty_previous_evaluation

 def test_fail_wrong_name_1_with_non_empty_previous_evaluation(self):
     trig = PropertyTriggerExpression('Empti', [], {})
     token = None
     simpleTests.test_evaluation(self, trig, self.eval2, token)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:4,代码来源:testPropertyStaticParameters.py


示例19: test_success_any_args_kwargs_6

 def test_success_any_args_kwargs_6(self):
     trig = PropertyTriggerExpression('Any', [ALitteral(pi), ALitteral(3), ALitteral(3)],
                                      {ALitteral(4): ALitteral(1.0), ALitteral('abc'): ALitteral(pi)})
     token = None
     simpleTests.test_evaluation(self, trig, self.eval2, token, self.eval2)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:5,代码来源:testPropertyStaticParameters.py


示例20: test_success_two_kwargs_not_enough_kwargs_2

 def test_success_two_kwargs_not_enough_kwargs_2(self):
     trig = PropertyTriggerExpression('ETwoKW', [], {ALitteral('def'): ALitteral(12)})
     token = None
     print Property.properties
     simpleTests.test_evaluation(self, trig, self.eval2, token, self.eval2)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:5,代码来源:testPropertyStaticParameters.py



注:本文中的test.testsTriggersExpressions.simpleTests.test_evaluation函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python testutil.random_string函数代码示例发布时间:2022-05-27
下一篇:
Python stacklevel.inner函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap