44from tests .utils .date import randomPastDate
55from tests .utils .transaction import generateExampleTransactionsJson
66from tests .utils .user import exampleProject
7+ from starkbank .error import StarkError
78
89
910starkbank .user = exampleProject
1011
1112
1213class TestTransactionPost (TestCase ):
1314
14- def test_success (self ):
15- transactions = starkbank .transaction .create (generateExampleTransactionsJson (n = 5 ))
16- self .assertEqual (len (transactions ), 5 )
17- for transaction in transactions :
18- print (transaction )
15+ def test_deprecated_error (self ):
16+ with self .assertRaises (StarkError ):
17+ starkbank .transaction .create (generateExampleTransactionsJson (n = 5 ))
1918
2019
2120class TestTransactionQuery (TestCase ):
2221
2322 def test_success (self ):
2423 transactions = list (starkbank .transaction .query (limit = 10 ))
2524 self .assertEqual (len (transactions ), 10 )
26- print ("Number of transactions:" , len (transactions ))
2725
2826 def test_success_after_before (self ):
2927 after = randomPastDate (days = 10 )
3028 before = datetime .today ()
3129 transactions = list (starkbank .transaction .query (after = after .date (), before = before .date (), limit = 10 ))
3230 self .assertLessEqual (len (transactions ), 10 )
3331 for transaction in transactions :
34- print (transaction )
32+ self . assertIsNotNone (transaction . id )
3533
3634
3735class TestTransactionPage (TestCase ):
@@ -42,7 +40,7 @@ def test_success(self):
4240 for _ in range (2 ):
4341 transactions , cursor = starkbank .transaction .page (limit = 2 , cursor = cursor )
4442 for transaction in transactions :
45- print (transaction )
43+ self . assertIsNotNone (transaction . id )
4644 self .assertFalse (transaction .id in transactionIds )
4745 transactionIds .append (transaction .id )
4846 if cursor is None :
0 commit comments