def setUp(self): self.client = Client() sys_register("借款测试", "imbus123", "柜员", "13966667777") status_code, response_dict = sys_login("借款测试", "imbus123") self.bank_teller_token = response_dict['token'] status_code, response_dict = add_customer(self.bank_teller_token, "客户一", "13100003456", "330888855570001", 1000.0) self.customer_id = response_dict["customer_id"] status_code, response_dict = customer_loan(self.bank_teller_token, self.customer_id, 300, 30, '2021-3-20') self.loan_record_id = response_dict["loan_record_id"] # 未到期借款测试 customer_loan(self.bank_teller_token, self.customer_id, 300, 300, '2021-3-20') # 账户余额不够归还本金测试 customer_loan(self.bank_teller_token, self.customer_id, 3000, 30, '2021-3-20') status_code, response_dict = add_customer(self.bank_teller_token, "客户二", "13100003457", "330888855570002", 1.0) customer_id = response_dict["customer_id"] # 账户余额不够罚金测试 customer_loan(self.bank_teller_token, customer_id, 300, 3, '2021-3-20')
def setUp(self): self.client = Client() sys_register("投资查询测试", "imbus123", "柜员", "13966667777") status_code, response_dict = sys_login("投资查询测试", "imbus123") self.bank_teller_token = response_dict['token'] status_code, response_dict = add_customer(self.bank_teller_token, "客户一", "13100006789", "330888855590001", 10000000.0) self.customer_id = response_dict["customer_id"] status_code, response_dict = issue_fund(self.bank_teller_token, "基金一号", '2021-3-20', 3.0) fund_id = response_dict['fund_id'] buy_fund(self.bank_teller_token, self.customer_id, fund_id, 700, "2021-3-21", 100) status_code, response_dict = issue_stock(self.bank_teller_token, "浦发银行", '2021-3-20', 15) stock_id = response_dict['stock_id'] buy_stock(self.bank_teller_token, self.customer_id, stock_id, 200, "2021-3-21") status_code, response_dict = issue_regular_deposit( self.bank_teller_token, "定期理财一号", '2021-3-20', 9, 0.07) regular_deposit_id = response_dict['regular_deposit_id'] buy_regular_deposit(self.bank_teller_token, self.customer_id, regular_deposit_id, 100, "2021-3-21")
def setUp(self): self.client = Client() sys_register("客户测试", "imbus123", "柜员", "13966667777") status_code, response_dict = sys_login("客户测试", "imbus123") self.bank_teller_token = response_dict['token'] self.id_number = "330888855550002" add_customer(self.bank_teller_token, "客户二", "13100001235", self.id_number, 1000.0)
def setUp(self): self.client = Client() sys_register("账户测试", "imbus123", "柜员", "13966667777") status_code, response_dict = sys_login("账户测试", "imbus123") self.bank_teller_token = response_dict['token'] status_code, response_dict = add_customer(self.bank_teller_token, "客户一", "13100002345", "330888855560001", 1000.0) self.customer_id = response_dict["customer_id"]
def setUp(self): self.client = Client() sys_register("存款记录测试", "imbus123", "柜员", "13966667777") status_code, response_dict = sys_login("存款记录测试", "imbus123") self.bank_teller_token = response_dict['token'] status_code, response_dict = add_customer(self.bank_teller_token, "客户一", "13200006789", "330888855690001", 10000000.0) self.customer_id = response_dict["customer_id"] customer_deposit(self.bank_teller_token, self.customer_id, 100)
def setUp(self): self.client = Client() sys_register("实体类测试", "imbus123", "柜员", "13966667777") status_code, response_dict = sys_login("实体类测试", "imbus123") bank_teller_token = response_dict['token'] status_code, response_dict = issue_fund(bank_teller_token, "基金一号", '2021-3-20', 3.2) self.fund_id = response_dict['fund_id'] status_code, response_dict = issue_stock(bank_teller_token, "招商银行", '2021-3-30', 15) self.stock_id = response_dict['stock_id']
def setUp(self): self.client = Client() sys_register("借款查询测试", "imbus123", "柜员", "13966667777") status_code, response_dict = sys_login("借款查询测试", "imbus123") self.bank_teller_token = response_dict['token'] status_code, response_dict = add_customer(self.bank_teller_token, "客户一", "13100004567", "330888855580001", 1000.0) self.customer_id = response_dict["customer_id"] status_code, response_dict = customer_loan(self.bank_teller_token, self.customer_id, 300, 30, '2021-3-20') self.loan_record_id = response_dict["loan_record_id"]
def setUp(self): self.client = Client() sys_register("还款记录测试", "imbus123", "柜员", "13966667777") status_code, response_dict = sys_login("还款记录测试", "imbus123") self.bank_teller_token = response_dict['token'] status_code, response_dict = add_customer(self.bank_teller_token, "客户一", "13200006789", "330888855690001", 10000000.0) self.customer_id = response_dict["customer_id"] status_code, response_dict = customer_loan(self.bank_teller_token, self.customer_id, 100, 30, "2021-3-20") loan_record_id = response_dict['loan_record_id'] customer_loan_repay(self.bank_teller_token, loan_record_id, 100)
def setUp(self): self.client = Client() sys_register("股票投资记录测试", "imbus123", "柜员", "13966667777") status_code, response_dict = sys_login("股票投资记录测试", "imbus123") self.bank_teller_token = response_dict['token'] status_code, response_dict = add_customer(self.bank_teller_token, "客户一", "13200006789", "330888855690001", 10000000.0) self.customer_id = response_dict["customer_id"] status_code, response_dict = issue_stock(self.bank_teller_token, "浦发银行", '2021-3-20', 15) stock_id = response_dict['stock_id'] buy_stock(self.bank_teller_token, self.customer_id, stock_id, 200, "2021-3-21")
def setUp(self): self.client = Client() sys_register("投资市场测试", "imbus123", "柜员", "13966667777") status_code, response_dict = sys_login("投资市场测试", "imbus123") self.bank_teller_token = response_dict['token'] status_code, response_dict = issue_fund(self.bank_teller_token, "基金二号", '2021-3-20', 3.2) self.fund_id = response_dict['fund_id'] status_code, response_dict = issue_stock(self.bank_teller_token, "招商银行", '2021-3-30', 15) self.stock_id = response_dict['stock_id'] status_code, response_dict = issue_regular_deposit( self.bank_teller_token, "定期理财二号", '2021-3-9', 9, 0.07) self.regular_deposit_id = response_dict['regular_deposit_id']
def test_bank_teller_register(self): # 正确注册测试 status_code, response_dict = sys_register("注册测试", "imbus123", "柜员三", "13966667777") self.assertEqual(200, status_code) self.assertEqual("register bank teller success", response_dict["msg"]) # 缺少参数注册测试 status_code, response_dict = sys_register("注册测试", "imbus123", "柜员三") self.assertEqual(400, status_code) self.assertEqual("parameter missing or invalid parameter", response_dict) # 密码过于简单测试 status_code, response_dict = sys_register("注册测试", "i", "柜员三", "13966667777") self.assertEqual(403, status_code) self.assertEqual("password not accepted, too simple", response_dict) # 账户已存在测试 status_code, response_dict = sys_register("注册测试", "imbus123", "柜员三", "13966667777") self.assertEqual(403, status_code) self.assertEqual("account already exist", response_dict)
def setUp(self): self.client = Client() sys_register("登录测试", "imbus123", "柜员四", "13966667777")