本文整理汇总了Python中gittip.testing.Harness.setUp方法的典型用法代码示例。如果您正苦于以下问题:Python Harness.setUp方法的具体用法?Python Harness.setUp怎么用?Python Harness.setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gittip.testing.Harness
的用法示例。
在下文中一共展示了Harness.setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.testing.Harness import setUp [as 别名]
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)
示例2: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.testing.Harness import setUp [as 别名]
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()
示例3: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.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'
)
示例4: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.testing.Harness import setUp [as 别名]
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()
示例5: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.testing.Harness import setUp [as 别名]
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)
示例6: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.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 = 'www.gittip.com'
wireup.canonical(env)
示例7: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.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')
示例8: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.testing.Harness import setUp [as 别名]
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)
示例9: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.testing.Harness import setUp [as 别名]
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)
示例10: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.testing.Harness import setUp [as 别名]
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')
示例11: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.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.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)
示例12: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.testing.Harness import setUp [as 别名]
def setUp(self):
Harness.setUp(self)
for participant in ["alice", "bob"]:
self.make_participant(participant, last_bill_result="")
示例13: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.testing.Harness import setUp [as 别名]
def setUp(self):
Harness.setUp(self)
self.alice = self.make_participant('alice', elsewhere='github')
示例14: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.testing.Harness import setUp [as 别名]
def setUp(self):
Harness.setUp(self)
self.bar = self.make_participant('bar', is_admin=True)
示例15: setUp
# 需要导入模块: from gittip.testing import Harness [as 别名]
# 或者: from gittip.testing.Harness import setUp [as 别名]
def setUp(self):
Harness.setUp(self)
self.website = _test_website
self.client = TestClient()