@@ -29,28 +29,28 @@ async def test_basics(self) -> None:
2929 # Create the state machine by calling its constructor. The fact that the
3030 # state machine _has_ a constructor means that this step is required
3131 # before other methods can be called on it.
32- account , _ = await Account .Open (context , customer_name = "Alice" )
32+ account , _ = await Account .open (context , customer_name = "Alice" )
3333
3434 # We can now call methods on the state machine. It should have a balance
3535 # of 0.
36- response : BalanceResponse = await account .Balance (context )
36+ response : BalanceResponse = await account .balance (context )
3737 self .assertEqual (response .balance , 0 )
3838
3939 # When we deposit money, the balance should go up.
40- await account .Deposit (context , amount = 100 )
41- response = await account .Balance (context )
40+ await account .deposit (context , amount = 100 )
41+ response = await account .balance (context )
4242 self .assertEqual (response .balance , 100 )
4343
4444 # When we withdraw money, the balance should go down.
45- await account .Withdraw (context , amount = 60 )
46- response = await account .Balance (context )
45+ await account .withdraw (context , amount = 60 )
46+ response = await account .balance (context )
4747 self .assertEqual (response .balance , 40 )
4848
4949 # When we withdraw too much money, we should get an error.
5050 # Use a helper function here to get a code snippet for use in docs.
5151 async def withdraw ():
5252 try :
53- await account .Withdraw (context , amount = 65 )
53+ await account .withdraw (context , amount = 65 )
5454 except Account .WithdrawAborted as aborted :
5555 match aborted .error :
5656 case OverdraftError (amount = amount ):
@@ -67,7 +67,7 @@ async def withdraw():
6767 self .assertTrue (isinstance (aborted .exception .error , OverdraftError ))
6868 self .assertEqual (aborted .exception .error .amount , 25 )
6969 # ... and the balance shouldn't have changed.
70- response = await account .Balance (context )
70+ response = await account .balance (context )
7171 self .assertEqual (response .balance , 40 )
7272
7373 @mock .patch ("account_servicer.send_email" )
@@ -87,7 +87,7 @@ async def test_send_welcome_email(self, mock_send_email) -> None:
8787
8888 # When we open an account, we expect the user to receive a welcome
8989 # email.
90- account , open_response = await Account .Open (
90+ account , open_response = await Account .open (
9191 context ,
9292 customer_name = "Alice" ,
9393 )
0 commit comments