コード例 #1
0
 def test_main_report_input_negative(self):
     try:
         main("asbsd users ravinderassdas", self.class_map)
         assert False
     except Exception as e:
         assert True
コード例 #2
0
 def test_main_report_users_at_credit_limit(self,
                                            mock_users_at_credit_limit):
     assert main("report users-at-credit-limit",
                 self.class_map) == "ravinder"
コード例 #3
0
 def test_main_report_total_dues(self, mock_total_discount_merchant):
     assert main("report total-dues", self.class_map) == "total: 300"
コード例 #4
0
 def test_main_report_user(self, mock_total_discount_merchant):
     assert main("report dues ravinder", self.class_map) == 100.27
コード例 #5
0
 def test_main_report_user_negative(self):
     try:
         main("report dues ravinderassdas", self.class_map)
         assert False
     except Exception as e:
         assert True
コード例 #6
0
 def test_main_payback_negative_user(self):
     try:
         main("payback ravi 1000", self.class_map)
         assert False
     except Exception as e:
         assert True
コード例 #7
0
 def test_main_report_discount(self, mock_total_discount_merchant):
     assert main("report discount merchant", self.class_map) == 6.25
コード例 #8
0
 def test_main_payback_positive(self, mock_check_limit, mock_update_limit):
     assert main("payback ravinder 1000",
                 self.class_map) == "ravinder(dues:0.0)"
コード例 #9
0
 def test_main_payback_negative_limit(self, mock_update_limit):
     try:
         main("payback ravinder 1000", self.class_map)
         assert False
     except Exception as e:
         assert True
コード例 #10
0
 def test_main_create_update(self, mock_update_discount):
     assert main("update merchant merchant 10", self.class_map) == True
コード例 #11
0
 def test_main_create_update_negative(self):
     try:
         main("update merchant masdasda 10", self.class_map)
         assert False
     except Exception as e:
         assert True
コード例 #12
0
 def test_main_create_transcation_wrong_input(self):
     try:
         main("new 123 ravinderqww merchant 1000", self.class_map)
         assert False
     except Exception as e:
         assert True
コード例 #13
0
 def test_main_create_transcation_wrong_merchant(self):
     try:
         main("new txn ravinder merchant123 1000", self.class_map)
         assert False
     except Exception as e:
         assert True
コード例 #14
0
 def test_main_create_transcation(self, mock_check_transct):
     assert main("new txn ravinder merchant 1000",
                 self.class_map) == "success"
コード例 #15
0
 def test_main_create_user_negative(self):
     try:
         main("new user ravinder baid [email protected] 10000", self.class_map)
         assert False
     except Exception as e:
         assert True
コード例 #16
0
 def test_main_create_user(self, mock_create_user):
     assert main("new user ravinder [email protected] 10000",
                 self.class_map) == "ravinder(1000)"