示例#1
0
 def banker_bet_status(self):
     res1 = self.get_m()
     order_id = bet(uid=self.uid,
                    period=self.period,
                    chose='option_A',
                    coin_type='free_bean',
                    amount=10000,
                    punter='banker',
                    banker_odds=1)
     events = []
     for uid in self.uids:
         kw = dict(uid=uid,
                   period=self.period,
                   chose='option_B',
                   coin_type='free_bean',
                   amount=100,
                   punter='buyer')
         events.append(gevent.spawn(bet, **kw))
         if uid == self.uids[5]:
             # events.append(gevent.spawn(settlement, period=self.period, win_option='option_A')) # 结算
             events.append(
                 gevent.spawn(update_status, self.period,
                              'locking'))  # blockade封盘 locking锁定
     gevent.joinall(events)
     settlement(period=self.period, win_option='option_B')
     res2 = self.get_m()
     self.cmp(res1, res2)
示例#2
0
 def banker_bet_change_banker(self):
     res1 = self.get_m()
     order_id = bet(uid=self.uid,
                    period=self.period,
                    chose='option_A',
                    coin_type='cat_bean',
                    amount=10000,
                    punter='banker',
                    banker_odds=1)
     events = []
     for uid in self.uids:
         kw = dict(uid=uid,
                   period=self.period,
                   chose='option_B',
                   coin_type='cat_bean',
                   amount=100,
                   punter='buyer')
         events.append(gevent.spawn(bet, **kw))
         if uid == self.uids[5]:
             events.append(
                 gevent.spawn(change_banker, self.uid, self.period,
                              order_id))  # 撤庄
             # events.append(gevent.spawn(change_banker, self.uid, self.period, order_id, 2, 'change')) # 修改庄
     gevent.joinall(events)
     settlement(period=self.period, win_option='option_A')
     res2 = self.get_m()
     self.cmp(res1, res2)
示例#3
0
 def banker_bet_bet_person(self):
     bet(uid=self.uid,
         period=self.period,
         chose='option_A',
         coin_type='cat_bean',
         amount=100000,
         punter='banker',
         banker_odds=0.01)
     events = []
     for i in self.uids:
         kw = dict(uid=self.uid,
                   period=self.period,
                   chose='option_B',
                   coin_type='cat_bean',
                   amount=200000,
                   punter='buyer')
         events.append(gevent.spawn(bet, **kw))
     gevent.joinall(events)
示例#4
0
 def gamble_settlement_settlement(self):
     Common.set_xd(self.uid, 200)
     Common.set_money(self.uid, 0, 200)
     Common.set_xd(1523, 200)
     Common.set_money(1523, 0, 200)
     bet(uid=self.uid,
         period=self.period,
         chose='option_A',
         coin_type='free_bean',
         amount=100)
     bet(uid=1523,
         period=self.period,
         chose='option_B',
         coin_type='free_bean',
         amount=100)
     events = []
     for i in self.uids:
         events.append(
             gevent.spawn(settlement,
                          period=self.period,
                          win_option='option_B'))
     gevent.joinall(events)
示例#5
0
 def banker_settlement(self):
     res1 = self.get_m()
     order_id = bet(uid=self.uid,
                    period=self.period,
                    chose='option_B',
                    coin_type='free_bean',
                    amount=100,
                    punter='banker',
                    banker_odds=1)
     bet(uid=self.uid,
         period=self.period,
         chose='option_A',
         coin_type='free_bean',
         amount=100,
         punter='buyer')
     events = []
     for i in uids:
         events.append(
             gevent.spawn(settlement,
                          period=self.period,
                          win_option='option_B'))
     gevent.joinall(events)
     res2 = self.get_m()
     self.cmp(res1, res2)
示例#6
0
 def banker_change_banker_new(self):
     res1 = self.get_m()
     order_id = bet(uid=self.uid,
                    period=self.period,
                    chose='option_B',
                    coin_type='cat_bean',
                    amount=100,
                    punter='banker',
                    banker_odds=1)
     events = []
     events.append(
         gevent.spawn(change_banker, self.uid, self.period, order_id, 3,
                      'change'))
     events.append(
         gevent.spawn(change_banker, self.uid, self.period, order_id, 2,
                      'change'))
     gevent.joinall(events)
     settlement(period=self.period, win_option='option_A')
     res2 = self.get_m()
     self.cmp(res1, res2)
示例#7
0
 def banker_change_banker_status(self):
     res1 = self.get_m()
     order_id = bet(uid=self.uid,
                    period=self.period,
                    chose='option_B',
                    coin_type='cat_bean',
                    amount=100,
                    punter='banker',
                    banker_odds=1)
     events = []
     events.append(
         gevent.spawn(change_banker, self.uid, self.period, order_id))
     # events.append(gevent.spawn(update_status, self.period, 'blockade'))  # blockade #封盘 locking锁定
     events.append(
         gevent.spawn(settlement, period=self.period,
                      win_option='option_A'))  # 结算
     gevent.joinall(events)
     settlement(period=self.period, win_option='option_B')
     res2 = self.get_m()
     self.cmp(res1, res2)
示例#8
0
from guess import create, banker, bet,settlement,Calculation
#
# REDIS_INST.delete('hm_new_guess_active_recharge_joins_tag')
# exit()

period = create()
banker(uid=1522, period=period, coin_type='cat_bean', amount=500000)
banker(uid=1522, period=period, coin_type='cat_bean', amount=500000,chose=2)




bet(35499, period=period, coin_type='cat_bean', punter='buyer',
    chose={  # 下注选项
        0: {'chose': 1, 'amount': 1000, 'now_odds': 2},
        1: {'chose': 2, 'amount': 1000, 'now_odds': 2},

    }, )


bet(35499, period=period, coin_type='cat_bean', punter='buyer',
    chose={  # 下注选项
        0: {'chose': 1, 'amount': 2000, 'now_odds': 2}

    }, )


bet(35499, period=period, coin_type='cat_bean', punter='buyer',
    chose={  # 下注选项
        0: {'chose': 2, 'amount': 2000, 'now_odds': 2}
    }, )