From 454935bd76a9106ad6eda4d5c3d0861d6e559777 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Wed, 23 May 2018 17:31:01 +0000 Subject: more flakes. Signed-off-by: Nils Gillmann --- src/fs/test_gnunet_fs_idx.py.in | 60 ++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'src/fs/test_gnunet_fs_idx.py.in') diff --git a/src/fs/test_gnunet_fs_idx.py.in b/src/fs/test_gnunet_fs_idx.py.in index 30592c2e4..a669998fb 100755 --- a/src/fs/test_gnunet_fs_idx.py.in +++ b/src/fs/test_gnunet_fs_idx.py.in @@ -25,50 +25,50 @@ import re import shutil srcdir = "../.." -gnunet_pyexpect_dir = os.path.join (srcdir, "contrib/scripts") +gnunet_pyexpect_dir = os.path.join(srcdir, "contrib/scripts") if gnunet_pyexpect_dir not in sys.path: - sys.path.append (gnunet_pyexpect_dir) + sys.path.append(gnunet_pyexpect_dir) from gnunet_pyexpect import pexpect if os.name == 'posix': - download = './gnunet-download' - gnunetarm = 'gnunet-arm' - publish = './gnunet-publish' - unindex = './gnunet-unindex' + download = './gnunet-download' + gnunetarm = 'gnunet-arm' + publish = './gnunet-publish' + unindex = './gnunet-unindex' elif os.name == 'nt': - download = './gnunet-download.exe' - gnunetarm = 'gnunet-arm.exe' - publish = './gnunet-publish.exe' - unindex = './gnunet-unindex.exe' + download = './gnunet-download.exe' + gnunetarm = 'gnunet-arm.exe' + publish = './gnunet-publish.exe' + unindex = './gnunet-unindex.exe' if os.name == "nt": - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "gnunet-test-fs-py-idx"), True) + shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-idx"), True) else: - shutil.rmtree ("/tmp/gnunet-test-fs-py-idx", True) + shutil.rmtree("/tmp/gnunet-test-fs-py-idx", True) -arm = subprocess.Popen ([gnunetarm, '-sq', '-c', 'test_gnunet_fs_idx_data.conf']) -arm.communicate () +arm = subprocess.Popen([gnunetarm, '-sq', '-c', 'test_gnunet_fs_idx_data.conf']) +arm.communicate() try: - pub = pexpect () + pub = pexpect() - pub.spawn (None, [publish, '-c', 'test_gnunet_fs_idx_data.conf', '-m', "description:Test archive", '-k', 'tst', 'test_gnunet_fs_rec_data.tgz'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - pub.expect ("stdout", re.compile (r"URI is `gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR\.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG\.17822'\.\r?\n")) + pub.spawn(None, [publish, '-c', 'test_gnunet_fs_idx_data.conf', '-m', "description:Test archive", '-k', 'tst', 'test_gnunet_fs_rec_data.tgz'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + pub.expect("stdout", re.compile(r"URI is `gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR\.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG\.17822'\.\r?\n")) - down = pexpect () - down.spawn (None, [download, '-c', 'test_gnunet_fs_idx_data.conf', '-o', 'test_gnunet_fs_rec_data.tar.gz', 'gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG.17822'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - down.expect ("stdout", re.compile (r"Downloading `test_gnunet_fs_rec_data.tar.gz' done (.*).\r?\n")) - os.remove ("test_gnunet_fs_rec_data.tar.gz") + down = pexpect() + down.spawn(None, [download, '-c', 'test_gnunet_fs_idx_data.conf', '-o', 'test_gnunet_fs_rec_data.tar.gz', 'gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG.17822'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + down.expect("stdout", re.compile(r"Downloading `test_gnunet_fs_rec_data.tar.gz' done (.*).\r?\n")) + os.remove("test_gnunet_fs_rec_data.tar.gz") - un = pexpect () - un.spawn (None, [unindex, '-c', 'test_gnunet_fs_idx_data.conf', 'test_gnunet_fs_rec_data.tgz'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - un.expect ("stdout", re.compile (r'Unindexing done\.\r?\n')) + un = pexpect() + un.spawn(None, [unindex, '-c', 'test_gnunet_fs_idx_data.conf', 'test_gnunet_fs_rec_data.tgz'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + un.expect("stdout", re.compile(r'Unindexing done\.\r?\n')) finally: - arm = subprocess.Popen ([gnunetarm, '-eq', '-c', 'test_gnunet_fs_idx_data.conf']) - arm.communicate () - if os.name == "nt": - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "gnunet-test-fs-py-idx"), True) - else: - shutil.rmtree ("/tmp/gnunet-test-fs-py-idx", True) + arm = subprocess.Popen([gnunetarm, '-eq', '-c', 'test_gnunet_fs_idx_data.conf']) + arm.communicate() + if os.name == "nt": + shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-idx"), True) + else: + shutil.rmtree("/tmp/gnunet-test-fs-py-idx", True) -- cgit v1.2.3