示例#1
0
    def test_check_unpaid(self):
        backend = BitcoinBackend(dict(BITCOIN_VALUE=300, URL=''))
        backend.make_rpc = FakeBTCRPCUnpaid

        backend.check(self.p)
        self.assertEqual(self.p.status, 'new')
        self.assertEqual(self.p.paid_amount, 0)
示例#2
0
    def test_check_unpaid(self):
        backend = BitcoinBackend(dict(URL=''))
        backend.make_rpc = FakeBTCRPCUnpaid

        backend.check(self.p)
        self.assertEqual(self.p.status, 'new')
        self.assertEqual(self.p.paid_amount, 0)
示例#3
0
 def test_check_paid(self):
     backend = BitcoinBackend(dict(BITCOIN_VALUE=300, URL=''))
     backend.make_rpc = FakeBTCRPCPaid
     backend.check(self.p)
     self.assertEqual(self.p.paid_amount, 300)
     self.assertEqual(self.p.status, 'confirmed')
示例#4
0
文件: bitcoin.py 项目: CCrypto/ccvpn3
 def test_check_partially_paid(self):
     backend = BitcoinBackend(dict(URL=''))
     backend.make_rpc = FakeBTCRPCPartial
     backend.check(self.p)
     self.assertEqual(self.p.status, 'new')
     self.assertEqual(self.p.paid_amount, 150)
示例#5
0
 def test_check_paid(self):
     backend = BitcoinBackend(dict(URL=''))
     backend.make_rpc = FakeBTCRPCPaid
     backend.check(self.p)
     self.assertEqual(self.p.paid_amount, 300)
     self.assertEqual(self.p.status, 'confirmed')
示例#6
0
 def test_check_partially_paid(self):
     backend = BitcoinBackend(dict(URL=''))
     backend.make_rpc = FakeBTCRPCPartial
     backend.check(self.p)
     self.assertEqual(self.p.status, 'new')
     self.assertEqual(self.p.paid_amount, 150)