Remove shebangs from test files

They should be executed with a runner like nose, not directly.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-10-04 15:20:01 +02:00
parent 26962d94ca
commit 43fb06e00f
33 changed files with 0 additions and 175 deletions

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import mock
@ -92,7 +91,3 @@ class TestExclusiveExcludeArch(unittest.TestCase):
self.assertTrue(is_excluded(pkg, ['x86_64'], logger=log))
self.assertEqual(log.mock_calls,
[mock.call.debug("Excluding (EXCLUSIVEARCH: ['aarch64']): pkg.rpm")])
if __name__ == "__main__":
unittest.main()

View File

@ -1,11 +1,6 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
try:
import unittest2 as unittest
except ImportError:
import unittest
import mock
import os
@ -1015,7 +1010,3 @@ class TestTweakConfigs(PungiTestCase):
self.assertEqual(
f.read().strip(),
':LABEL=new\\\\x20volid ks=hd:LABEL=new\\\\x20volid:/ks.cfg')
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import mock
@ -521,7 +520,3 @@ class StatusTest(unittest.TestCase):
self.compose.conf['gather_backend'] = 'yum'
self.compose.conf['createrepo_database'] = False
self.assertFalse(self.compose.should_create_yum_database)
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
@ -483,7 +482,3 @@ class SkipPhasesTestCase(ConfigTestCase):
skip_phases=skip_phases,
)
self.assertNotEqual(checks.validate(cfg), ([], []))
if __name__ == '__main__':
unittest.main()

View File

@ -1,11 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
import unittest2 as unittest
except ImportError:
import unittest
import mock
import os
@ -942,7 +937,3 @@ class TweakTreeinfo(helpers.PungiTestCase):
ti.dump(output)
self.assertFilesEqual(output, expected)
if __name__ == '__main__':
unittest.main()

View File

@ -1,7 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import mock
import os
@ -218,7 +216,3 @@ class CreateIsoScriptTest(helpers.PungiTestCase):
'--template=%s/jigdo/DP-1.0-20160405.t.3-x86_64.iso.template' % self.topdir,
'--no-servers-section', '--report=noprogress', self.topdir + '/os//'])]
)
if __name__ == '__main__':
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
try:

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-

View File

@ -1,10 +1,8 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import mock
import os
import sys
import unittest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
@ -169,7 +167,3 @@ class TestCopyFiles(helpers.PungiTestCase):
self.assertEqual(len(get_file_from_scm.call_args_list), 0)
self.assertEqual(get_dir_from_scm.call_args_list, [])
if __name__ == "__main__":
unittest.main()

View File

@ -1,11 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
import unittest2 as unittest
except ImportError:
import unittest
import mock
import os
@ -922,7 +917,3 @@ class PrepareMetadataTest(helpers.PungiTestCase):
),
],
)
if __name__ == '__main__':
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
try:

View File

@ -1,11 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
try:
import unittest2 as unittest
except ImportError:
import unittest
import mock
import os
@ -993,7 +987,3 @@ class TestCreateImageBuildThread(PungiTestCase):
with self.assertRaises(RuntimeError):
with mock.patch('time.sleep'):
t.process((compose, cmd), 1)
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
@ -198,7 +197,3 @@ class TestDumpChecksums(unittest.TestCase):
'MD5 (file2.iso) = cafebabe',
]
self.assertEqual(expected, data)
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
@ -557,7 +556,3 @@ class TestValidateComps(unittest.TestCase):
self.assertEqual(
CompsWrapper.mock_calls, [mock.call("/path"), mock.call().validate()]
)
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import json
@ -801,7 +800,3 @@ class TestGetBuildrootRPMs(unittest.TestCase):
'kbd-2.0.2-8.fc23.x86_64',
'coreutils-8.24-6.fc23.x86_64',
])
if __name__ == "__main__":
unittest.main()

View File

@ -1,13 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import mock
import errno
try:
import unittest2 as unittest
except ImportError:
import unittest
import os
import stat
import sys
@ -342,7 +337,3 @@ class TestLinkerLink(TestLinkerBase):
self.assertTrue(self.same_inode(self.file1, self.hardlink1))
self.linker.link(self.src_dir, self.dst_dir, link_type="copy")
self.assertTrue(self.same_inode(self.dst_file1, self.dst_hardlink1))
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,6 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import unittest
import mock
import os
@ -768,7 +766,3 @@ class TestCreateLiveImageThread(PungiTestCase):
mock.call('[FAIL] Live (variant Client, arch amd64, subvariant Client) failed, but going on anyway.'),
mock.call('BOOM')
])
if __name__ == "__main__":
unittest.main()

View File

@ -1,7 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import unittest
import mock
import sys
@ -679,7 +677,3 @@ class TestLiveMediaThread(PungiTestCase):
'name': 'Fedora Server Live',
'repo': ['/repo/$basearch/Server'],
})])
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
try:
@ -141,7 +140,3 @@ class MediaSplitterTestCase(unittest.TestCase):
self.assertEqual(ms.split(),
[{'files': ['first', 'second', 'third'], 'size': bl(145)}])
self.assertUnlimited(bl(25 + 40 + 80))
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import json
import mock
import unittest
import os
import sys
@ -247,7 +244,3 @@ class TestWriteExtraFiles(helpers.PungiTestCase):
files.append('missing_file')
self.assertRaises(RuntimeError, metadata.write_extra_files, tree_dir, files, 'sha256', mock_logger)
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
@ -142,7 +141,3 @@ class TestNotifier(unittest.TestCase):
self.assertEqual(run.call_args_list, [self._call('run-notify', 'cmd')])
self.assertTrue(self.compose.log_warning.called)
if __name__ == "__main__":
unittest.main()

View File

@ -1,10 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
import unittest2 as unittest
except ImportError:
import unittest
import mock
import json
@ -561,7 +556,3 @@ class OSBSThreadTest(helpers.PungiTestCase):
self._assertCorrectCalls({'git_branch': 'f24-docker'}, scratch=True)
self._assertCorrectMetadata(scratch=True)
self._assertRepoFile()
if __name__ == '__main__':
unittest.main()

View File

@ -1,8 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import mock
import os
@ -633,7 +630,3 @@ class OstreeThreadTest(helpers.PungiTestCase):
mock.call('Runroot task failed: 1234. See %s/%s/runroot.log for more details.'
% (self.topdir, LOG_PATH))
])
if __name__ == '__main__':
unittest.main()

View File

@ -1,9 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import unittest
import mock
import os
@ -507,7 +505,3 @@ class OSTreeThreadTest(helpers.PungiTestCase):
'http://example.com/work/$basearch/comps_repo_Everything')
self.assertEqual(extra_config.get("repo").pop()["baseurl"], "http://example.com/repo/1")
self.assertEqual(extra_config.get('repo').pop()['baseurl'], 'http://url/to/repo/a')
if __name__ == '__main__':
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
@ -66,7 +65,3 @@ class TestPathMatch(unittest.TestCase):
self.assertEqual(sorted(self.pm["/lib"]), ["/star2"])
self.assertEqual(sorted(self.pm["/lib/foo"]), ["/star/star1", "/star2"])
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import mock
@ -135,7 +134,3 @@ class TestWeaver(unittest.TestCase):
self.assertMissed(self.p4)
self.assertFinalized(self.p5)
self.assertFinalized(self.p6)
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import mock
@ -593,7 +592,3 @@ class TestSaveFileList(unittest.TestCase):
rpms = f.read().strip().split('\n')
self.assertItemsEqual(rpms, ['pungi@4.1.3@3.fc25@noarch',
'pungi@4.1.3@3.fc25@src'])
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import mock
@ -399,7 +398,3 @@ class CvsSCMTestCase(SCMBaseTest):
self.assertEqual(
commands,
['/usr/bin/cvs -q -d http://example.com/cvs export -r HEAD subdir'])
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
@ -434,7 +433,3 @@ class TestRepoclosure(PungiTestCase):
with self.assertRaises(RuntimeError):
test_phase.run_repoclosure(compose)
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import mock

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import argparse
@ -873,7 +872,3 @@ class TestCopyAll(PungiTestCase):
self.assertTrue(os.path.islink(os.path.join(self.dst, "symlink")))
self.assertEqual(os.readlink(os.path.join(self.dst, "symlink")), "broken")
if __name__ == "__main__":
unittest.main()