def test_case01(self, lr, jj): #1. 准备测试数据 lr = lr #2. 执行测试步骤:调用利润计算去计算 act_jj = LiRunJiSuan.jisuan(lr) #3. 定义期望值 exp_jj = jj self.assertEqual(exp_jj, act_jj)
def test_case08(self): # 1. 测试准备测试数据 zlr = 101 # 2. 运行测试步骤,并获取实际结果 act_jj = LiRunJiSuan.jisuan(zlr) # 3. 定义期望结果 exp_jj = 3.96 # 4. 判断期望奖金与实际奖金是否相等 self.assertEqual(exp_jj, act_jj)
def test_something(self): #1. 准备测试数据 zlr = 40 #2. 运行测试步骤,并获取实际结果 act_jj = LiRunJiSuan.jisuan(zlr) #3. 定义期望结果 exp_jj = #4. 判断期望奖金与实际奖金是否相等 self.assertEqual(exp_jj, act_jj)
def test_case01(self, lr, jj): #1. 准备测试数据 zlr = lr #2. 运行测试步骤,并获取实际结果 act_jj = LiRunJiSuan.jisuan(zlr) #3. 定义期望结果 exp_jj =jj #4. 判断期望奖金与实际奖金是否相等 self.assertEqual(exp_jj, act_jj)
def test_case10(self): lr = "@" act_jj = LiRunJiSuan.jisuan(lr) exp_jj = "None" self.assertEqual(act_jj, exp_jj)
def test_case09(self): lr = 100.1 act_jj = LiRunJiSuan.jisuan(lr) exp_jj = 3.95 self.assertEqual(act_jj, exp_jj)
def test_case08(self): lr = -10 act_jj = LiRunJiSuan.jisuan(lr) exp_jj ="请输入正数" self.assertEqual(act_jj, exp_jj)
def test_case06(self): lr = 0 act_jj = LiRunJiSuan.jisuan(lr) exp_jj = 0.0 self.assertEqual(act_jj, exp_jj)
def test_case03(self): lr = 40 act_jj = LiRunJiSuan.jisuan(lr) exp_jj = 2.75 self.assertEqual(act_jj, exp_jj)