当前位置: 首页>>代码示例>>Python>>正文


Python testing.Harness类代码示例

本文整理汇总了Python中gittip.testing.Harness的典型用法代码示例。如果您正苦于以下问题:Python Harness类的具体用法?Python Harness怎么用?Python Harness使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Harness类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

    def setUp(self):
        Harness.setUp(self)

        self._blech = (os.environ["CANONICAL_SCHEME"], os.environ["CANONICAL_HOST"])
        os.environ["CANONICAL_SCHEME"] = "https"
        os.environ["CANONICAL_HOST"] = "www.gittip.com"
        wireup.canonical()
开发者ID:JeffSpies,项目名称:www.gittip.com,代码行数:7,代码来源:test_hooks.py

示例2: setUp

    def setUp(self):
        Harness.setUp(self)
        self.alice = self.make_participant('alice', elsewhere='github')

        self.balanced_customer_href = unicode(balanced.Customer().save().href)
        self.card_href = unicode(balanced.Card(
            number='4111111111111111',
            expiration_month=10,
            expiration_year=2020,
            address={
                'line1': "123 Main Street",
                'state': 'Confusion',
                'postal_code': '90210',
            },
            # gittip stores some of the address data in the meta fields,
            # continue using them to support backwards compatibility
            meta={
                'address_2': 'Box 2',
                'city_town': '',
                'region': 'Confusion',
            }
        ).save().href) # XXX Why don't we actually associate this with the customer? See XXX in
                       # test_billing_payday.TestPaydayChargeOnBalanced.
        self.bank_account_href = unicode(balanced.BankAccount(
            name='Homer Jay',
            account_number='112233a',
            routing_number='121042882',
        ).save().href)
开发者ID:Aaron1011,项目名称:www.gittip.com,代码行数:28,代码来源:balanced.py

示例3: setUp

    def setUp(self):
        Harness.setUp(self)

        # Alice joins a community.
        self.alice = self.make_participant("alice", claimed_time='now', last_bill_result='')
        self.client.POST( '/for/communities.json'
                        , {'name': 'something', 'is_member': 'true'}
                        , auth_as='alice'
                         )
开发者ID:Alive-AttemptTheLifeGangHouse,项目名称:www.gittip.com,代码行数:9,代码来源:test_communities.py

示例4: setUp

    def setUp(self):
        self.client = TestClient()
        Harness.setUp(self)

        self._blech = ( os.environ['CANONICAL_SCHEME']
                      , os.environ['CANONICAL_HOST']
                       )
        os.environ['CANONICAL_SCHEME'] = 'https'
        os.environ['CANONICAL_HOST'] = 'www.gittip.com'
        wireup.canonical()
开发者ID:abnor,项目名称:www.gittip.com,代码行数:10,代码来源:test_hooks.py

示例5: setUp

    def setUp(self):
        Harness.setUp(self)

        # Grab configuration from the environment, storing for later.
        env = wireup.env()
        self.environ = env.environ

        # Change env, doesn't change self.environ.
        env.canonical_scheme = 'https'
        env.canonical_host = 'www.gittip.com'

        wireup.canonical(env)
开发者ID:Alive-AttemptTheLifeGangHouse,项目名称:www.gittip.com,代码行数:12,代码来源:test_hooks.py

示例6: setUp

    def setUp(self):
        Harness.setUp(self)
        now = utcnow()
        hour_ago = now - datetime.timedelta(hours=1)
        for username in ["alice", "bob", "carl"]:
            self.make_participant(username, claimed_time=hour_ago, last_bill_result="")
        deadbeef = self.make_elsewhere("twitter", "1", "deadbeef")
        self.deadbeef_original_username = deadbeef.participant.username

        Participant.from_username("carl").set_tip_to("bob", "1.00")
        Participant.from_username("alice").set_tip_to(self.deadbeef_original_username, "1.00")
        Participant.from_username("bob").take_over(deadbeef, have_confirmation=True)
开发者ID:venmo,项目名称:www.gittip.com,代码行数:12,代码来源:test_participant.py

示例7: setUp

    def setUp(self):
        Harness.setUp(self)

        self.alice = self.make_participant('alice', claimed_time='now')
        self.bob = self.make_participant('bob', claimed_time='now')
        self.carl = self.make_participant('carl', claimed_time='now')
        self.make_exchange('bill', 10, 0, self.alice)
        self.make_exchange('bill', 10, 0, self.bob)
        self.make_participant('notactive', claimed_time='now')

        self.alice.set_tip_to(self.carl, '1.00')
        self.bob.set_tip_to(self.carl, '2.00')
开发者ID:maryannbanks,项目名称:www.gittip.com,代码行数:12,代码来源:test_charts_json.py

示例8: setUp

    def setUp(self):
        Harness.setUp(self)
        now = utcnow()
        hour_ago = now - datetime.timedelta(hours=1)
        for username in ['alice', 'bob', 'carl']:
            self.make_participant( username
                                 , claimed_time=hour_ago
                                 , last_bill_result=''
                                  )
        deadbeef = TwitterAccount(self.db, '1', {'screen_name': 'deadbeef'})
        self.deadbeef_original_username = deadbeef.participant

        Participant.from_username('carl').set_tip_to('bob', '1.00')
        Participant.from_username('alice').set_tip_to(self.deadbeef_original_username, '1.00')
        Participant.from_username('bob').take_over(deadbeef, have_confirmation=True)
开发者ID:BastianBerndsen,项目名称:www.gittip.com,代码行数:15,代码来源:test_participant.py

示例9: setUp

    def setUp(self):
        Harness.setUp(self)

        self.alice = self.make_participant('alice', balance=10, claimed_time='now')
        self.bob = self.make_participant('bob', balance=10, claimed_time='now')
        self.carl = self.make_participant('carl', claimed_time='now')
        self.db.run("""
            INSERT INTO EXCHANGES
                (amount, fee, participant) VALUES
                (10.00, 0.00, 'alice'),
                (10.00, 0.00, 'bob')
        """)
        self.make_participant('notactive', claimed_time='now')

        self.alice.set_tip_to(self.carl, '1.00')
        self.bob.set_tip_to(self.carl, '2.00')
开发者ID:atunit,项目名称:www.gittip.com,代码行数:16,代码来源:test_charts_json.py

示例10: setUp

    def setUp(self):
        Harness.setUp(self)
        now = utcnow()
        hour_ago = now - datetime.timedelta(hours=1)
        for username in ['alice', 'bob', 'carl']:
            p = self.make_participant( username
                                     , claimed_time=hour_ago
                                     , last_bill_result=''
                                      )
            setattr(self, username, p)
        deadbeef = self.make_elsewhere('twitter', '1', 'deadbeef')
        self.deadbeef_original_username = deadbeef.participant.username

        self.carl.set_tip_to(self.bob, '1.00')
        self.alice.set_tip_to(self.deadbeef_original_username, '1.00')
        self.bob.take_over(deadbeef, have_confirmation=True)
开发者ID:atunit,项目名称:www.gittip.com,代码行数:16,代码来源:test_participant.py

示例11: make_participant

 def make_participant(self, username, *arg, **kw):
     participant = Harness.make_participant(self, username)
     if username == "alice":
         take_last_week = kw.get("take_last_week", "40")
         gittip.db.execute("INSERT INTO paydays DEFAULT VALUES")
         gittip.db.execute(
             "INSERT INTO transfers " "(timestamp, tipper, tippee, amount) " "VALUES (now(), 'Team', 'alice', %s)",
             (take_last_week,),
         )
     return participant
开发者ID:joealcorn,项目名称:www.gittip.com,代码行数:10,代码来源:test_take.py

示例12: setUp

    def setUp(self):
        Harness.setUp(self)
        now = utcnow()
        hour_ago = now - datetime.timedelta(hours=1)
        for i, username in enumerate(['alice', 'bob', 'carl']):
            p = self.make_participant( username
                                     , claimed_time=hour_ago
                                     , last_bill_result=''
                                     , balance=Decimal(i)
                                      )
            setattr(self, username, p)

        deadbeef = self.make_participant('deadbeef', balance=Decimal('18.03'), elsewhere='twitter')
        self.expected_new_balance = self.bob.balance + deadbeef.balance
        deadbeef_twitter = AccountElsewhere.from_user_name('twitter', 'deadbeef')

        self.carl.set_tip_to(self.bob, '1.00')
        self.alice.set_tip_to(deadbeef, '1.00')
        self.bob.take_over(deadbeef_twitter, have_confirmation=True)
        self.deadbeef_archived = Participant.from_id(deadbeef.id)
开发者ID:Siecje,项目名称:www.gittip.com,代码行数:20,代码来源:test_participant.py

示例13: make_participant

 def make_participant(self, username, *arg, **kw):
     take_last_week = kw.pop('take_last_week', '40')
     participant = Harness.make_participant(self, username, **kw)
     if username == 'alice':
         gittip.db.run("INSERT INTO paydays DEFAULT VALUES")
         gittip.db.run( "INSERT INTO transfers "
                        "(timestamp, tipper, tippee, amount) "
                        "VALUES (now(), 'Team', 'alice', %s)"
                      , (take_last_week,)
                       )
     return participant
开发者ID:angleman,项目名称:www.gittip.com,代码行数:11,代码来源:test_take.py

示例14: make_participant

 def make_participant(self, username, **kw):
     take_last_week = kw.pop('take_last_week', None)
     team_name = kw.pop('', TEAM)
     participant = Harness.make_participant(self, username, **kw)
     if take_last_week is not None:
         if self.db.one('SELECT * FROM paydays') is None:
             self.db.run("INSERT INTO paydays DEFAULT VALUES")
         self.db.run( "INSERT INTO transfers (timestamp, tipper, tippee, amount) "
                      "VALUES (now(), %(tipper)s, %(tippee)s, %(amount)s)"
                    , dict(tipper=team_name, tippee=username, amount=take_last_week,)
                     )
     return participant
开发者ID:atunit,项目名称:www.gittip.com,代码行数:12,代码来源:test_take.py

示例15: make_participant

 def make_participant(self, *a, **kw):
     kw['claimed_time'] = datetime.datetime.now(pytz.utc)
     return Harness.make_participant(self, *a, **kw)
开发者ID:ChimeraCoder,项目名称:www.gittip.com,代码行数:3,代码来源:test_public_json.py


注:本文中的gittip.testing.Harness类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。