summaryrefslogtreecommitdiff
path: root/tests/sources
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-09 10:35:38 +0000
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-20 09:38:42 +0000
commit010d10b611e5288ac9a105bce3efcfe85f01ba9f (patch)
treefb70390a89071f27586fdc8f86884770e47474f1 /tests/sources
parentfaa85d293211239f1da2fb4c6ab4c910d238dd75 (diff)
downloadbuildstream-010d10b611e5288ac9a105bce3efcfe85f01ba9f.tar.gz
tests:lint: remove all unneccessary-parens errors from pylint
Diffstat (limited to 'tests/sources')
-rw-r--r--tests/sources/deb.py6
-rw-r--r--tests/sources/local.py18
-rw-r--r--tests/sources/patch.py8
-rw-r--r--tests/sources/remote.py16
-rw-r--r--tests/sources/tar.py12
-rw-r--r--tests/sources/zip.py8
6 files changed, 34 insertions, 34 deletions
diff --git a/tests/sources/deb.py b/tests/sources/deb.py
index 684c9e961..554110319 100644
--- a/tests/sources/deb.py
+++ b/tests/sources/deb.py
@@ -118,7 +118,7 @@ def test_stage_default_basedir(cli, tmpdir, datafiles):
original_dir = os.path.join(str(datafiles), "content")
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
# Test that a staged checkout matches what was tarred up, with an empty base-dir
@@ -146,7 +146,7 @@ def test_stage_no_basedir(cli, tmpdir, datafiles):
original_dir = os.path.join(str(datafiles), "content")
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
# Test that a staged checkout matches what was tarred up, with an explicit basedir
@@ -174,4 +174,4 @@ def test_stage_explicit_basedir(cli, tmpdir, datafiles):
original_dir = os.path.join(str(datafiles), "content")
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
diff --git a/tests/sources/local.py b/tests/sources/local.py
index c494e2671..7df1cd9ea 100644
--- a/tests/sources/local.py
+++ b/tests/sources/local.py
@@ -82,7 +82,7 @@ def test_stage_file(cli, tmpdir, datafiles):
result.assert_success()
# Check that the checkout contains the expected file
- assert(os.path.exists(os.path.join(checkoutdir, 'file.txt')))
+ assert os.path.exists(os.path.join(checkoutdir, 'file.txt'))
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'directory'))
@@ -97,8 +97,8 @@ def test_stage_directory(cli, tmpdir, datafiles):
result.assert_success()
# Check that the checkout contains the expected file and directory and other file
- assert(os.path.exists(os.path.join(checkoutdir, 'file.txt')))
- assert(os.path.exists(os.path.join(checkoutdir, 'subdir', 'anotherfile.txt')))
+ assert os.path.exists(os.path.join(checkoutdir, 'file.txt'))
+ assert os.path.exists(os.path.join(checkoutdir, 'subdir', 'anotherfile.txt'))
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'symlink'))
@@ -122,9 +122,9 @@ def test_stage_symlink(cli, tmpdir, datafiles):
result.assert_success()
# Check that the checkout contains the expected file and directory and other file
- assert(os.path.exists(os.path.join(checkoutdir, 'file.txt')))
- assert(os.path.exists(os.path.join(checkoutdir, 'symlink-to-file.txt')))
- assert(os.path.islink(os.path.join(checkoutdir, 'symlink-to-file.txt')))
+ assert os.path.exists(os.path.join(checkoutdir, 'file.txt'))
+ assert os.path.exists(os.path.join(checkoutdir, 'symlink-to-file.txt'))
+ assert os.path.islink(os.path.join(checkoutdir, 'symlink-to-file.txt'))
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'file-exists'))
@@ -152,6 +152,6 @@ def test_stage_directory_symlink(cli, tmpdir, datafiles):
result.assert_success()
# Check that the checkout contains the expected directory and directory symlink
- assert(os.path.exists(os.path.join(checkoutdir, 'subdir', 'anotherfile.txt')))
- assert(os.path.exists(os.path.join(checkoutdir, 'symlink-to-subdir', 'anotherfile.txt')))
- assert(os.path.islink(os.path.join(checkoutdir, 'symlink-to-subdir')))
+ assert os.path.exists(os.path.join(checkoutdir, 'subdir', 'anotherfile.txt'))
+ assert os.path.exists(os.path.join(checkoutdir, 'symlink-to-subdir', 'anotherfile.txt'))
+ assert os.path.islink(os.path.join(checkoutdir, 'symlink-to-subdir'))
diff --git a/tests/sources/patch.py b/tests/sources/patch.py
index 761656580..51cdc2186 100644
--- a/tests/sources/patch.py
+++ b/tests/sources/patch.py
@@ -81,7 +81,7 @@ def test_stage_and_patch(cli, tmpdir, datafiles):
# Test the file.txt was patched and changed
with open(os.path.join(checkoutdir, 'file.txt')) as f:
- assert(f.read() == 'This is text file with superpowers\n')
+ assert f.read() == 'This is text file with superpowers\n'
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'basic'))
@@ -117,7 +117,7 @@ def test_stage_separate_patch_dir(cli, tmpdir, datafiles):
# Test the file.txt was patched and changed
with open(os.path.join(checkoutdir, 'test-dir', 'file.txt')) as f:
- assert(f.read() == 'This is text file in a directory with superpowers\n')
+ assert f.read() == 'This is text file in a directory with superpowers\n'
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'multiple-patches'))
@@ -133,7 +133,7 @@ def test_stage_multiple_patches(cli, tmpdir, datafiles):
# Test the file.txt was patched and changed
with open(os.path.join(checkoutdir, 'file.txt')) as f:
- assert(f.read() == 'This is text file with more superpowers\n')
+ assert f.read() == 'This is text file with more superpowers\n'
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'different-strip-level'))
@@ -149,4 +149,4 @@ def test_patch_strip_level(cli, tmpdir, datafiles):
# Test the file.txt was patched and changed
with open(os.path.join(checkoutdir, 'file.txt')) as f:
- assert(f.read() == 'This is text file with superpowers\n')
+ assert f.read() == 'This is text file with superpowers\n'
diff --git a/tests/sources/remote.py b/tests/sources/remote.py
index 5ca2f79d2..48e8c3df5 100644
--- a/tests/sources/remote.py
+++ b/tests/sources/remote.py
@@ -95,13 +95,13 @@ def test_simple_file_build(cli, tmpdir, datafiles):
# Note that the url of the file in target.bst is actually /dir/file
# but this tests confirms we take the basename
checkout_file = os.path.join(checkoutdir, 'file')
- assert(os.path.exists(checkout_file))
+ assert os.path.exists(checkout_file)
mode = os.stat(checkout_file).st_mode
# Assert not executable by anyone
- assert(not (mode & (stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)))
+ assert not mode & (stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
# Assert not writeable by anyone other than me
- assert(not (mode & (stat.S_IWGRP | stat.S_IWOTH)))
+ assert not mode & (stat.S_IWGRP | stat.S_IWOTH)
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'single-file-custom-name'))
@@ -125,8 +125,8 @@ def test_simple_file_custom_name_build(cli, tmpdir, datafiles):
'artifact', 'checkout', 'target.bst', '--directory', checkoutdir
])
result.assert_success()
- assert(not os.path.exists(os.path.join(checkoutdir, 'file')))
- assert(os.path.exists(os.path.join(checkoutdir, 'custom-file')))
+ assert not os.path.exists(os.path.join(checkoutdir, 'file'))
+ assert os.path.exists(os.path.join(checkoutdir, 'custom-file'))
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'unique-keys'))
@@ -179,9 +179,9 @@ def test_executable(cli, tmpdir, datafiles):
'artifact', 'checkout', 'target-custom-executable.bst', '--directory', checkoutdir
])
mode = os.stat(os.path.join(checkoutdir, 'some-custom-file')).st_mode
- assert (mode & stat.S_IEXEC)
+ assert mode & stat.S_IEXEC
# Assert executable by anyone
- assert(mode & (stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH))
+ assert mode & (stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
@pytest.mark.parametrize('server_type', ('FTP', 'HTTP'))
@@ -213,4 +213,4 @@ def test_use_netrc(cli, datafiles, server_type, tmpdir):
result.assert_success()
checkout_file = os.path.join(checkoutdir, 'file')
- assert(os.path.exists(checkout_file))
+ assert os.path.exists(checkout_file)
diff --git a/tests/sources/tar.py b/tests/sources/tar.py
index 8d7d37c56..ed99036b2 100644
--- a/tests/sources/tar.py
+++ b/tests/sources/tar.py
@@ -147,7 +147,7 @@ def test_stage_default_basedir(cli, tmpdir, datafiles, srcdir):
original_dir = os.path.join(str(datafiles), "content", "a")
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
# Test that a staged checkout matches what was tarred up, with an empty base-dir
@@ -176,7 +176,7 @@ def test_stage_no_basedir(cli, tmpdir, datafiles, srcdir):
original_dir = os.path.join(str(datafiles), "content")
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
# Test that a staged checkout matches what was tarred up, with an explicit basedir
@@ -205,7 +205,7 @@ def test_stage_explicit_basedir(cli, tmpdir, datafiles, srcdir):
original_dir = os.path.join(str(datafiles), "content", "a")
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
# Test that we succeed to extract tarballs with hardlinks when stripping the
@@ -241,7 +241,7 @@ def test_stage_contains_links(cli, tmpdir, datafiles):
original_dir = os.path.join(str(datafiles), "content", "base-directory")
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
@pytest.mark.skipif(not HAVE_LZIP, reason='lzip is not available')
@@ -270,7 +270,7 @@ def test_stage_default_basedir_lzip(cli, tmpdir, datafiles, srcdir):
original_dir = os.path.join(str(datafiles), "content", "a")
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
# Test that a tarball that contains a read only dir works
@@ -355,7 +355,7 @@ def test_use_netrc(cli, datafiles, server_type, tmpdir):
original_dir = os.path.join(str(datafiles), 'content', 'a')
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
@pytest.mark.parametrize('server_type', ('FTP', 'HTTP'))
diff --git a/tests/sources/zip.py b/tests/sources/zip.py
index c15453242..273c0c3a4 100644
--- a/tests/sources/zip.py
+++ b/tests/sources/zip.py
@@ -131,7 +131,7 @@ def test_stage_default_basedir(cli, tmpdir, datafiles):
original_dir = os.path.join(str(datafiles), "content", "a")
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
# Test that a staged checkout matches what was tarred up, with an empty base-dir
@@ -159,7 +159,7 @@ def test_stage_no_basedir(cli, tmpdir, datafiles):
original_dir = os.path.join(str(datafiles), "content")
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
# Test that a staged checkout matches what was tarred up, with an explicit basedir
@@ -187,7 +187,7 @@ def test_stage_explicit_basedir(cli, tmpdir, datafiles):
original_dir = os.path.join(str(datafiles), "content", "a")
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents
@pytest.mark.parametrize('server_type', ('FTP', 'HTTP'))
@@ -228,4 +228,4 @@ def test_use_netrc(cli, datafiles, server_type, tmpdir):
original_dir = os.path.join(str(datafiles), 'content', 'a')
original_contents = list_dir_contents(original_dir)
checkout_contents = list_dir_contents(checkoutdir)
- assert(checkout_contents == original_contents)
+ assert checkout_contents == original_contents