def test_tc_6_wager_bet_usd_currency(self): wager = create_bet() wager.Currency = "USD" player, revenue, _ = self._create_player_with_wager([wager]) result = self.get_wager_from_db(player) logging.info("DB result: {}".format(result)) self.assertFalse(result == [])
def _create_wagers(player, wagers=[]): _wagers = [create_bet()] if wagers == [] else wagers logging.info("Creating wagers: {}".format( [r.__dict__ for r in _wagers])) data = { "PlayerID": player.PlayerID, "InitID": generate_random_int(), "Wagers": [r.__dict__ for r in _wagers] } logging.info("Request data: {}".format(json.dumps(data))) response = requests.post(get_wager_betting_resource(), data=json.dumps(data), headers=get_api_headers()) logging.info("API response: {}".format(response.json())) return wagers, response.json()["RequestID"]
def test_tc_13_wager_bet_invalid_event_date(self): wager = create_bet() wager.EventDate = "invalid_date" player, revenue, request_id = self._create_player_with_wager([wager]) result = self.get_wager_from_db(player) self.assertFalse(result == [])
def test_tc_12_wager_bet_huge_count(self): wager = create_bet() wager.Count = 100000000000000 player, revenue, request_id = self._create_player_with_wager([wager]) result = self.get_wager_from_db(player) self.assertFalse(result == [])
def test_tc_11_wager_bet_negative_count(self): wager = create_bet() wager.Count = -1 player, revenue, request_id = self._create_player_with_wager([wager]) self.assert_not_created(request_id, player)
def test_tc_8_wager_bet_future_transaction_date(self): wager = create_bet() wager.TransactionDate = generate_random_date(is_future=True) player, revenue, request_id = self._create_player_with_wager([wager]) self.assert_not_created(request_id, player)
def test_tc_7_wager_bet_invalid_transaction_date(self): wager = create_bet() wager.TransactionDate = "invalid_date" player, revenue, request_id = self._create_player_with_wager([wager]) self.assert_not_created(request_id, player)
def test_tc_5_wager_bet_zero_amount(self): wager = create_bet() wager.Value = 0 player, revenue, request_id = self._create_player_with_wager([wager]) self.assert_not_created(request_id, player)
def test_tc_3_wager_bet_string_amount(self): wager = create_bet() wager.Value = "value" player, revenue, request_id = self._create_player_with_wager([wager]) self.assert_not_created(request_id, player)
def test_tc_2_wager_bet_invalid_currency(self): wager = create_bet() wager.Currency = "Invalid" player, revenue, request_id = self._create_player_with_wager([wager]) self.assert_not_created(request_id, player)
def test_tc_16_wager_bet_non_existing_event(self): wager = create_bet() wager.Event = None player, revenue, request_id = self._create_player_with_wager([wager]) self.assert_not_created(request_id, player)
def test_tc_15_wager_bet_non_existing_category(self): wager = create_bet() wager.EventCategory = generate_random_string() player, revenue, request_id = self._create_player_with_wager([wager]) result = self.get_wager_from_db(player) self.assertFalse(result == [])
def test_tc_14_wager_bet_past_event_date(self): wager = create_bet() wager.EventDate = generate_random_date() player, revenue, request_id = self._create_player_with_wager([wager]) result = self.get_wager_from_db(player) self.assertFalse(result == [])