99
1010
1111def execute (args ):
12- """ Execute a specified command """
12+ """Execute a specified command"""
1313 subprocess .run (args )
1414
1515
1616def execute_jafar_and_miniooni (ooni_exe , outfile , experiment , tag , args ):
17- """ Executes jafar and miniooni. Returns the test keys. """
17+ """Executes jafar and miniooni. Returns the test keys."""
1818 tmpoutfile = "/tmp/{}" .format (outfile )
1919 with contextlib .suppress (FileNotFoundError ):
2020 os .remove (tmpoutfile ) # just in case
@@ -40,17 +40,17 @@ def execute_jafar_and_miniooni(ooni_exe, outfile, experiment, tag, args):
4040
4141
4242def read_result (outfile ):
43- """ Reads the result of an experiment """
43+ """Reads the result of an experiment"""
4444 return json .load (open (outfile , "rb" ))
4545
4646
4747def test_keys (result ):
48- """ Returns just the test keys of a specific result """
48+ """Returns just the test keys of a specific result"""
4949 return result ["test_keys" ]
5050
5151
5252def check_maybe_binary_value (value ):
53- """ Make sure a maybe binary value is correct """
53+ """Make sure a maybe binary value is correct"""
5454 assert isinstance (value , str ) or (
5555 isinstance (value , dict )
5656 and value ["format" ] == "base64"
@@ -59,8 +59,8 @@ def check_maybe_binary_value(value):
5959
6060
6161def with_free_port (func ):
62- """ This function executes |func| passing it a port number on localhost
63- which is bound but not listening for new connections """
62+ """This function executes |func| passing it a port number on localhost
63+ which is bound but not listening for new connections"""
6464 # See <https://stackoverflow.com/a/45690594>
6565 with contextlib .closing (socket .socket (socket .AF_INET , socket .SOCK_STREAM )) as sock :
6666 sock .bind (("127.0.0.1" , 0 ))
0 commit comments