1414import json
1515import os
1616import tempfile
17- from typing import List , Optional , cast
17+ from typing import List , cast
1818from unittest .mock import Mock
1919
2020import yaml
@@ -149,15 +149,12 @@ def _add_service(self, url, as_token, id) -> None:
149149 outfile .write (yaml .dump (as_yaml ))
150150 self .as_yaml_files .append (as_token )
151151
152- def _set_state (
153- self , id : str , state : ApplicationServiceState , txn : Optional [int ] = None
154- ):
152+ def _set_state (self , id : str , state : ApplicationServiceState ):
155153 return self .db_pool .runOperation (
156154 self .engine .convert_param_style (
157- "INSERT INTO application_services_state(as_id, state, last_txn) "
158- "VALUES(?,?,?)"
155+ "INSERT INTO application_services_state(as_id, state) VALUES(?,?)"
159156 ),
160- (id , state .value , txn ),
157+ (id , state .value ),
161158 )
162159
163160 def _insert_txn (self , as_id , txn_id , events ):
@@ -280,17 +277,6 @@ def test_complete_appservice_txn_first_txn(
280277 self .store .complete_appservice_txn (txn_id = txn_id , service = service )
281278 )
282279
283- res = self .get_success (
284- self .db_pool .runQuery (
285- self .engine .convert_param_style (
286- "SELECT last_txn FROM application_services_state WHERE as_id=?"
287- ),
288- (service .id ,),
289- )
290- )
291- self .assertEqual (1 , len (res ))
292- self .assertEqual (txn_id , res [0 ][0 ])
293-
294280 res = self .get_success (
295281 self .db_pool .runQuery (
296282 self .engine .convert_param_style (
@@ -316,14 +302,13 @@ def test_complete_appservice_txn_updates_last_txn_state(
316302 res = self .get_success (
317303 self .db_pool .runQuery (
318304 self .engine .convert_param_style (
319- "SELECT last_txn, state FROM application_services_state WHERE as_id=?"
305+ "SELECT state FROM application_services_state WHERE as_id=?"
320306 ),
321307 (service .id ,),
322308 )
323309 )
324310 self .assertEqual (1 , len (res ))
325- self .assertEqual (txn_id , res [0 ][0 ])
326- self .assertEqual (ApplicationServiceState .UP .value , res [0 ][1 ])
311+ self .assertEqual (ApplicationServiceState .UP .value , res [0 ][0 ])
327312
328313 res = self .get_success (
329314 self .db_pool .runQuery (
0 commit comments