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


Python Harness.setUp方法代码示例

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


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

示例1: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
 def setUp(self):
     Harness.setUp(self)
     self.mailer_patcher = mock.patch.object(Participant._mailer.messages, 'send')
     self.mailer = self.mailer_patcher.start()
     self.addCleanup(self.mailer_patcher.stop)
     sleep_patcher = mock.patch('gratipay.models.participant.sleep')
     sleep_patcher.start()
     self.addCleanup(sleep_patcher.stop)
开发者ID:HolaChica,项目名称:gratipay.com,代码行数:10,代码来源:emails.py

示例2: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
    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:9cat,项目名称:templecoin-gratipay,代码行数:11,代码来源:test_communities.py

示例3: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
    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:9cat,项目名称:templecoin-gratipay,代码行数:14,代码来源:test_charts_json.py

示例4: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
    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 = 'gratipay.com'

        wireup.canonical(env)
开发者ID:rohitpaulk,项目名称:gratipay.com,代码行数:14,代码来源:test_hooks.py

示例5: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
    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('balanced-cc', 10, 0, self.alice)
        self.make_exchange('balanced-cc', 10, 0, self.bob)
        self.make_participant('notactive', claimed_time='now')

        return # XXX upgrade these when you clean up this file
        self.alice.set_tip_to(self.carl, '1.00')
        self.bob.set_tip_to(self.carl, '2.00')
开发者ID:HolaChica,项目名称:gratipay.com,代码行数:15,代码来源:test_charts_json.py

示例6: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
    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("balanced-cc", 10, 0, self.alice)
        self.make_exchange("balanced-cc", 10, 0, self.bob)
        self.make_participant("notactive", claimed_time="now")

        return  # XXX upgrade these when you clean up this file
        self.alice.set_tip_to(self.carl, "1.00")
        self.bob.set_tip_to(self.carl, "2.00")
开发者ID:gratipay,项目名称:gratipay.com,代码行数:15,代码来源:test_charts_json.py

示例7: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
    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.make_tip(self.carl, self.bob, "1.00")
        self.make_tip(self.alice, deadbeef, "1.00")
        self.bob.take_over(deadbeef_twitter, have_confirmation=True)
        self.deadbeef_archived = Participant.from_id(deadbeef.id)
开发者ID:hdushku,项目名称:gratipay.com,代码行数:18,代码来源:test_participant.py

示例8: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
    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.make_tip(self.carl, self.bob, '1.00')
        self.make_tip(self.alice, deadbeef, '1.00')
        self.bob.take_over(deadbeef_twitter, have_confirmation=True)
        self.deadbeef_archived = Participant.from_id(deadbeef.id)
开发者ID:crowdfundingsourcecode,项目名称:gratipay.com,代码行数:22,代码来源:test_participant.py

示例9: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
 def setUp(self):
     Harness.setUp(self)
     simplate = self.client.load_resource(b'/about/stats.html')
     self.commaize = simplate.pages[0]['commaize']
开发者ID:gaurishankarprasad,项目名称:gratipay.com,代码行数:6,代码来源:test_stats.py

示例10: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
 def setUp(self):
     Harness.setUp(self)
     self.alice_elsewhere = self.make_elsewhere('twitter', -1, 'alice')
     token, expires = self.alice_elsewhere.make_connect_token()
     self.connect_cookie = {b'connect_%s' % self.alice_elsewhere.id: token}
     self.bob = self.make_participant('bob', claimed_time='now')
开发者ID:PeterDaveHello,项目名称:gratipay.com,代码行数:8,代码来源:test_elsewhere.py

示例11: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
 def setUp(self):
     self._old = Participant._generate_api_key
     seq = itertools.count(0)
     Participant._generate_api_key = lambda self: 'deadbeef{}'.format(next(seq))
     Harness.setUp(self)
开发者ID:9cat,项目名称:templecoin-gratipay,代码行数:7,代码来源:test_api_key_json.py

示例12: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
 def setUp(self):
     Harness.setUp(self)
     self.add_participant("alice")
     self.add_participant("bob")
     carl = self.add_participant("carl")
     carl.insert_into_communities(False, "test", "test")
开发者ID:Saudis,项目名称:gratipay.com,代码行数:8,代码来源:test_for_community_json.py

示例13: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
 def setUp(self):
     Harness.setUp(self)
     make_history(self)
开发者ID:augmen,项目名称:gratipay.com,代码行数:5,代码来源:test_history.py

示例14: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
 def setUp(self):
     Harness.setUp(self)
     self.__sleep_for = self.app.email_queue.sleep_for
     self.app.email_queue.sleep_for = 0
开发者ID:cyberjacob,项目名称:www.gittip.com,代码行数:6,代码来源:email.py

示例15: setUp

# 需要导入模块: from gratipay.testing import Harness [as 别名]
# 或者: from gratipay.testing.Harness import setUp [as 别名]
 def setUp(self):
     Harness.setUp(self)
     self.make_participant("team", claimed_time='now')
     self.make_participant("alice", claimed_time='now')
开发者ID:PeterDaveHello,项目名称:gratipay.com,代码行数:6,代码来源:test_membername_json.py


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