Django:测试时如何忽略函数中的代码部分

我不在乎(deftemplate glass (slot n(type FLOAT)) (slot m(type FLOAT)) (slot a(type FLOAT)) (slot b(type FLOAT)) (slot r(type FLOAT)) (slot s(type FLOAT)) (slot k(type FLOAT)) (slot c(type FLOAT))) (deftemplate Type (slot type)) (deffacts instances1 (glass (n 13.00) (m 2.28) (a 1.00) (b 0.00))) (deffacts instances2 (glass (n 13.70) (m 1.80) (a 1.40) (b 0.00))) (deffacts instances3 (glass (n 13.70) (m 1.90) (a 1.40) (b 0.00))) (defrule R1 (glass (b ?b)) (test (<= ?b 0.27)) (glass (m ?m)) (test (<= ?m 2.41)) (glass (n ?n)) (test (<= ?n 13.78)) (glass (a ?a)) (test (<= ?a 1.38)) => (assert (Type (type buildwindnonfloat1))) (printout t "buildwindnonfloat1 detected" crlf)) (defrule R2 (glass (b ?b)) (test (<= ?b 0.27)) (glass (m ?m)) (test (<= ?m 2.41)) (glass (n ?n)) (test (<= ?n 13.78)) (glass (a ?a)) (test (> ?a 1.38)) (glass (m ?m)) (test (<= ?m 1.88)) => (assert (Type (type containers2))) (printout t "containers2 detected" crlf)) (defrule R3 (glass (b ?b)) (test (<= ?b 0.27)) (glass (m ?m)) (test (<= ?m 2.41)) (glass (n ?n)) (test (<= ?n 13.78)) (glass (a ?a)) (test (> ?a 1.38)) (glass (m ?m)) (test (> ?m 1.88)) => (assert (Type (type buildwindnonfloat3))) (printout t "buildwindnonfloat3 detected" crlf)) (defrule R4 (glass (b ?b)) (test (<= ?b 0.27)) (glass (m ?m)) (test (<= ?m 2.41)) (glass (n ?n)) (test (> ?n 13.78)) => (assert (Type (type tableware4))) (printout t "tableware detected" crlf)) (defrule R5 (glass (b ?b)) (test (<= ?b 0.27)) (glass (m ?m)) (test (> ?m 2.41)) (glass (a ?a)) (test (<= ?a 1.4)) (glass (m ?m)) (test (<= ?m 3.34)) (glass (a ?a)) (test (<= ?a 1.25)) => (assert (Type (type buildwindnonfloat5))) (printout t "buildwindnonfloat5 detected" crlf)) (defrule R6 (glass (b ?b)) (test (<= ?b 0.27)) (glass (m ?m)) (test (> ?m 2.41)) (glass (a ?a)) (test (<= ?a 1.4)) (glass (m ?m)) (test (<= ?m 3.34)) (glass (a ?a)) (test (> ?a 1.25)) => (assert (Type (type buildwindfloat6))) (printout t "buildwindfloat6 detected" crlf)) (defrule R7 (glass (b ?b)) (test (<= ?b 0.27)) (glass (m ?m)) (test (> ?m 2.41)) (glass (a ?a)) (test (<= ?a 1.4)) (glass (m ?m)) (test (> ?m 3.34)) (glass (m ?m)) (test (<= ?m 3.82)) (glass (r ?r)) (test (<= ?r 1.51707)) (glass (r ?r)) (test (<= ?r 51596)) => (assert (Type (type buildwindfloat7))) (printout t "buildwindfloat7 detected" crlf)) DescribetargetGroupsRequest dtgr= new DescribetargetGroupsRequest { TargetGroupArns = new List<string> { targetGroupArn },LoadBalancerArn = loadBalancerArn }; amazonElbClient.DescribetargetGroups(dtgr); //where: //loadBalancerArn - correct,existing Load Balancer ARN,//targetGroupArn - correct,existing Target Group 做什么。我只需要断言some_other_functipn_2已被调用。这是我的代码的简化版本。我知道可以通过修补来完成,但是我的代码中有太多部分需要修补。无论如何,除了目标之外,还有其他什么可以忽略吗?

some_other_function
linzichao 回答:Django:测试时如何忽略函数中的代码部分

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3146832.html

大家都在问