示例#1
0
 def test_tc_4_create_game_session_casino_without_session_date(self):
     player = create_random_player(player_id_length=40)
     session = create_game_session()
     session.SessionDate = None
     data = {
         "PlayerID": player.PlayerID,
         "GameSessions": [session.__dict__]
     }
     channel = 1
     create_areto_api_object(resource=get_game_session_resource(channel),
                             data=data)
     for session in data['GameSessions']:
         q_net_session_list = get_game_session_response(player.PlayerID)
         self.assertEqual(len(q_net_session_list['fact']), 1)
         self.assertEqual(len(q_net_session_list['dim']), 1)
         fact = q_net_session_list['fact'][0]
         self.assertEqual(fact['MerchantID'],
                          int(get_config().get("api", "merchant_id")))
         self.assertTrue(fact['ActivityDate'])
         self.assertTrue(fact['DateCreated'])
         self.assertTrue(fact['ExternalCustomerID'], player.PlayerID)
         self.assertTrue(fact['ChannelID'], channel)
         self.assertTrue(fact['FactGameID'])
         self.assertTrue(fact['GameID'])
         self.assertGreaterEqual(fact['TimeID'], 0)
         self.assertGreaterEqual(fact['SignInID'], 0)
         game_id = fact['GameID']
         dim = q_net_session_list['dim'][0]
         self.assertEqual(dim['MerchantID'],
                          int(get_config().get("api", "merchant_id")))
         self.assertTrue(dim['DateCreated'])
         self.assertEqual(dim['GameName'], session['GameIdentifier'])
         self.assertEqual(dim['GameCategory'], session['GameType'])
         self.assertEqual(dim['GameID'], game_id)
    def test_tc_5_create_freespin_without_player_id(self):
        freespin = create_freespin(is_future=True)
        data = {
            "FreeSpins": [freespin.__dict__]
        }

        create_areto_api_object(resource=get_freespin_resource(), data=data, success=False,
                                             msg=get_api_error_player_id_not_passed())
    def test_tc_3_create_freespin_without_value(self):
        player = create_random_player(player_id_length=40)
        freespin = create_freespin(is_future=True)
        freespin.Value = None
        data = {
            "PlayerID": player.PlayerID,
            "FreeSpins": [freespin.__dict__]
        }

        request_id = create_areto_api_object(resource=get_freespin_resource(), data=data)

        verify_api_error(request_id, get_task_error_invalid_value())
    def test_tc_2_create_freespin_without_identifier(self):
        player = create_random_player(player_id_length=40)
        freespin = create_freespin(is_future=True)
        freespin.Identifier = None
        data = {
            "PlayerID": player.PlayerID,
            "FreeSpins": [freespin.__dict__]
        }

        logging.info("Data: {}".format(data))
        request_id = create_areto_api_object(resource=get_freespin_resource(), data=data)

        verify_api_error(request_id, get_task_error_invalid_identifier())
示例#5
0
    def test_tc_3_game_session_casion_without_game_identifier(self):
        player = create_random_player(player_id_length=40)
        session = create_game_session()
        session.GameIdentifier = None
        data = {
            "PlayerID": player.PlayerID,
            "GameSessions": [session.__dict__]
        }
        logging.info("Game session: {}".format(data))
        request_id = create_areto_api_object(
            resource=get_game_session_resource(), data=data)

        verify_api_error(request_id, get_task_error_invalid_game_identifier())
    def test_tc_4_create_freespin_without_transaction_date(self):
        player = create_random_player(player_id_length=40)
        freespin = create_freespin(is_future=True)
        freespin.TransactionDate = None
        data = {
            "PlayerID": player.PlayerID,
            "FreeSpins": [freespin.__dict__]
        }

        create_areto_api_object(resource=get_freespin_resource(), data=data)

        q_net_freespin_list = get_freespin_response(data.get('PlayerID'))
        self.assertEqual(len(q_net_freespin_list), 1)

        for e in q_net_freespin_list:
            self.assertEqual(e['MerchantID'], int(get_config().get("api", "merchant_id")))
            self.assertTrue(e['FactFreeSpinID'])
            self.assertTrue(e['TimeID'])
            #self.assertFalse(e['SignInID'])
            self.assertTrue(e['FreeSpinID'])
            self.assertTrue(e['DateCreated'])
            self.assertTrue(e['ActivityDate'])
            self.assertEqual(e['ExternalCustomerID'], data['PlayerID'])
    def test_tc_1_create_freespin_example(self):
        player = create_random_player(player_id_length=40)
        freespin = create_freespin()
        data = {
            "PlayerID": player.PlayerID,
            "FreeSpins": [freespin.__dict__]
        }
        request_id = create_areto_api_object(resource=get_freespin_resource(), data=data)
        q_net_freespin_list = get_freespin_response(data.get('PlayerID'))

        self.assertEqual(len(q_net_freespin_list), 1)

        for e in q_net_freespin_list:
            self.assertEqual(e['MerchantID'], int(get_config().get("api", "merchant_id")))
            self.assertTrue(e['FactFreeSpinID'])
            self.assertGreaterEqual(e['TimeID'], 0)
            self.assertGreaterEqual(e['SignInID'], 0)
            self.assertTrue(e['FreeSpinID'])
            self.assertTrue(e['DateCreated'])
            self.assertTrue(e['ActivityDate'])
            self.assertEqual(e['ExternalCustomerID'], data['PlayerID'])