summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkballou <kballou@devnulllabs.io>2015-04-22 20:49:38 -0600
committerkballou <kballou@devnulllabs.io>2015-04-22 20:49:38 -0600
commit8502b90fba729968915a8dbc35f17f75a3693855 (patch)
tree84ebd50302a15fe76cdff602708eb6543d85d0a5
parentf535ea7c8a036a63fce4c9c64aa4049563372692 (diff)
downloadxnt-8502b90fba729968915a8dbc35f17f75a3693855.tar.gz
xnt-8502b90fba729968915a8dbc35f17f75a3693855.tar.xz
Refactor: Use correct assert function for test
Was using the blanket `assertTrue` function, which is eaiser to use incorrectly. Switch to `assertIn` appropriately.
-rw-r--r--xnt/tests/compilercollectiontests.py34
-rw-r--r--xnt/tests/maketests.py30
-rw-r--r--xnt/tests/taskcompressiontests.py4
-rw-r--r--xnt/tests/taskcopytests.py10
-rw-r--r--xnt/tests/taskmisctests.py38
-rw-r--r--xnt/tests/taskmkdirtests.py6
-rw-r--r--xnt/tests/taskmovetests.py6
-rw-r--r--xnt/tests/taskremovetests.py2
-rw-r--r--xnt/tests/textests.py14
-rw-r--r--xnt/tests/vcscvstests.py10
-rw-r--r--xnt/tests/vcsgittests.py14
-rw-r--r--xnt/tests/vcshgtests.py16
12 files changed, 92 insertions, 92 deletions
diff --git a/xnt/tests/compilercollectiontests.py b/xnt/tests/compilercollectiontests.py
index 9ff30d6..476476a 100644
--- a/xnt/tests/compilercollectiontests.py
+++ b/xnt/tests/compilercollectiontests.py
@@ -32,16 +32,16 @@ class GccTests(unittest.TestCase):
"""Test Default GCC"""
result = __gcc__("hello.c")
assert_basic_assumptions(self, result)
- self.assertTrue("infile" in result[0][1])
- self.assertTrue('flags' in result[0][1])
+ self.assertIn("infile", result[0][1])
+ self.assertIn('flags', result[0][1])
def test_gcc_with_output(self):
"""Test GCC with output"""
result = __gcc__("hello.c", output="hello")
assert_basic_assumptions(self, result)
- self.assertTrue("infile" in result[0][1])
- self.assertTrue("outfile" in result[0][1])
- self.assertTrue('flags' in result[0][1])
+ self.assertIn("infile", result[0][1])
+ self.assertIn("outfile", result[0][1])
+ self.assertIn('flags', result[0][1])
# pylint: disable=R0904
class GppTests(unittest.TestCase):
@@ -51,16 +51,16 @@ class GppTests(unittest.TestCase):
"""Test Default G++"""
result = __gpp__("hello.cpp")
assert_basic_assumptions(self, result)
- self.assertTrue("infile" in result[0][1])
- self.assertTrue('flags' in result[0][1])
+ self.assertIn("infile", result[0][1])
+ self.assertIn('flags', result[0][1])
def test_gpp_with_output(self):
"""Test G++ with output"""
result = __gpp__("hello.cpp", output="hello")
assert_basic_assumptions(self, result)
- self.assertTrue("infile" in result[0][1])
- self.assertTrue("outfile" in result[0][1])
- self.assertTrue('flags' in result[0][1])
+ self.assertIn("infile", result[0][1])
+ self.assertIn("outfile", result[0][1])
+ self.assertIn('flags', result[0][1])
# pylint: disable=R0904
class NvccTests(unittest.TestCase):
@@ -70,16 +70,16 @@ class NvccTests(unittest.TestCase):
"""Test Default NVCC"""
result = __nvcc__("hello.cu")
assert_basic_assumptions(self, result)
- self.assertTrue("infile" in result[0][1])
- self.assertTrue('flags' in result[0][1])
+ self.assertIn("infile", result[0][1])
+ self.assertIn('flags', result[0][1])
def test_nvcc_with_output(self):
"""Test Named Output NVCC"""
result = __nvcc__("hello.cu", output="hello")
assert_basic_assumptions(self, result)
- self.assertTrue("infile" in result[0][1])
- self.assertTrue("outfile" in result[0][1])
- self.assertTrue('flags' in result[0][1])
+ self.assertIn("infile", result[0][1])
+ self.assertIn("outfile", result[0][1])
+ self.assertIn('flags', result[0][1])
# pylint: disable=R0904
class JavacTests(unittest.TestCase):
@@ -89,8 +89,8 @@ class JavacTests(unittest.TestCase):
"""Test Default Javac"""
result = __javac__("HelloWorld.java")
assert_basic_assumptions(self, result)
- self.assertTrue("sourcefiles" in result[0][1])
- self.assertTrue('flags' in result[0][1])
+ self.assertIn("sourcefiles", result[0][1])
+ self.assertIn('flags', result[0][1])
if __name__ == "__main__":
unittest.main()
diff --git a/xnt/tests/maketests.py b/xnt/tests/maketests.py
index de043fa..ccdd463 100644
--- a/xnt/tests/maketests.py
+++ b/xnt/tests/maketests.py
@@ -31,21 +31,21 @@ class AntTests(unittest.TestCase):
"""Test the default target of ant"""
result = __ant__(target="test")
assert_basic_assumptions(self, result)
- self.assertTrue('target' in result[0][1])
+ self.assertIn('target', result[0][1])
self.assertEqual('test', result[0][1]['target'])
def test_ant_when_given_path(self):
"""Test ant when passing given a path"""
result = __ant__(target="test", path="some/other/path/build.xml")
assert_basic_assumptions(self, result)
- self.assertTrue('path' in result[0][1])
+ self.assertIn('path', result[0][1])
self.assertEqual('some/other/path/build.xml', result[0][1]['path'])
def test_ant_when_given_flags(self):
"""Test passing flags to ant"""
result = __ant__(target='test', flags=['-verbose'])
assert_basic_assumptions(self, result)
- self.assertTrue('flags' in result[0][1])
+ self.assertIn('flags', result[0][1])
self.assertEqual(1, len(result[0][1]['flags']))
self.assertEqual('-verbose', result[0][1]['flags'][0])
@@ -55,8 +55,8 @@ class AntTests(unittest.TestCase):
pkeys=["test_var"],
pvalues=["testing"])
assert_basic_assumptions(self, result)
- self.assertTrue('pkeys' in result[0][1])
- self.assertTrue('pvalues' in result[0][1])
+ self.assertIn('pkeys', result[0][1])
+ self.assertIn('pvalues', result[0][1])
self.assertEqual(1, len(result[0][1]['pkeys']))
self.assertEqual(1, len(result[0][1]['pvalues']))
self.assertEqual('test_var', result[0][1]['pkeys'][0])
@@ -70,14 +70,14 @@ class MakeTests(unittest.TestCase):
"""Test Default make"""
result = __make__(target="build")
assert_basic_assumptions(self, result)
- self.assertTrue('target' in result[0][1])
+ self.assertIn('target', result[0][1])
self.assertEqual('build', result[0][1]['target'])
def test_make_with_path(self):
'''Test make given a path'''
result = __make__(target="build", path="some/other/path/Makefile")
assert_basic_assumptions(self, result)
- self.assertTrue('path' in result[0][1])
+ self.assertIn('path', result[0][1])
self.assertEqual('some/other/path/Makefile', result[0][1]['path'])
def test_passing_vars(self):
@@ -86,8 +86,8 @@ class MakeTests(unittest.TestCase):
pkeys=["test_var"],
pvalues=["testing"])
assert_basic_assumptions(self, result)
- self.assertTrue('pkeys' in result[0][1])
- self.assertTrue('pvalues' in result[0][1])
+ self.assertIn('pkeys', result[0][1])
+ self.assertIn('pvalues', result[0][1])
self.assertEqual(1, len(result[0][1]['pkeys']))
self.assertEqual(1, len(result[0][1]['pvalues']))
self.assertEqual('test_var', result[0][1]['pkeys'][0])
@@ -97,7 +97,7 @@ class MakeTests(unittest.TestCase):
"""Test Flag Passing with Make"""
result = __make__(target='build', flags=['-B'])
assert_basic_assumptions(self, result)
- self.assertTrue('flags' in result[0][1])
+ self.assertIn('flags', result[0][1])
self.assertEqual(1, len(result[0][1]['flags']))
self.assertEqual('-B', result[0][1]['flags'][0])
@@ -109,14 +109,14 @@ class NAntTests(unittest.TestCase):
"""Test Deault nant"""
result = __nant__(target='test')
assert_basic_assumptions(self, result)
- self.assertTrue('target' in result[0][1])
+ self.assertIn('target', result[0][1])
self.assertEqual('test', result[0][1]['target'])
def test_nant_with_path(self):
'''Test NAnt with path'''
result = __nant__(target='test', path='some/other/path/build.xml')
assert_basic_assumptions(self, result)
- self.assertTrue('path' in result[0][1])
+ self.assertIn('path', result[0][1])
self.assertEqual('some/other/path/build.xml', result[0][1]['path'])
def test_nant_with_parameters(self):
@@ -125,8 +125,8 @@ class NAntTests(unittest.TestCase):
pkeys=["test_var"],
pvalues=["testing"])
assert_basic_assumptions(self, result)
- self.assertTrue('pkeys' in result[0][1])
- self.assertTrue('pvalues' in result[0][1])
+ self.assertIn('pkeys', result[0][1])
+ self.assertIn('pvalues', result[0][1])
self.assertEqual(1, len(result[0][1]['pkeys']))
self.assertEqual(1, len(result[0][1]['pvalues']))
self.assertEqual('test_var', result[0][1]['pkeys'][0])
@@ -135,7 +135,7 @@ class NAntTests(unittest.TestCase):
'''Test NAnt with flags'''
result = __nant__(target="test", flags=["-v"])
assert_basic_assumptions(self, result)
- self.assertTrue('flags' in result[0][1])
+ self.assertIn('flags', result[0][1])
self.assertEqual(1, len(result[0][1]['flags']))
self.assertEqual('-v', result[0][1]['flags'][0])
diff --git a/xnt/tests/taskcompressiontests.py b/xnt/tests/taskcompressiontests.py
index 4c222aa..3f79625 100644
--- a/xnt/tests/taskcompressiontests.py
+++ b/xnt/tests/taskcompressiontests.py
@@ -29,9 +29,9 @@ class TaskCompressionTests(unittest.TestCase):
"""Test zip method"""
result = __zip__(directory="testfolder", zipfilename="myzip.zip")
assert_basic_assumptions(self, result)
- self.assertTrue("directory" in result[0][1])
+ self.assertIn("directory", result[0][1])
self.assertEqual("testfolder", result[0][1]['directory'])
- self.assertTrue("zipfile" in result[0][1])
+ self.assertIn("zipfile", result[0][1])
self.assertEqual("myzip.zip", result[0][1]['zipfile'])
if __name__ == "__main__":
diff --git a/xnt/tests/taskcopytests.py b/xnt/tests/taskcopytests.py
index f451595..21ebeee 100644
--- a/xnt/tests/taskcopytests.py
+++ b/xnt/tests/taskcopytests.py
@@ -9,7 +9,7 @@
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-# This program is distributed in the hope that it will be useful,
+# This program is distributed, the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -29,18 +29,18 @@ class TaskCopyTests(unittest.TestCase):
"""Test default use of cp"""
result = __copy__(src="test0", dstdir="test1")
assert_basic_assumptions(self, result)
- self.assertTrue('src' in result[0][1])
+ self.assertIn('src', result[0][1])
self.assertEqual('test0', result[0][1]['src'])
- self.assertTrue('dstdir' in result[0][1])
+ self.assertIn('dstdir', result[0][1])
self.assertEqual('test1', result[0][1]['dstdir'])
def test_cp_filelist(self):
"""Test filelist copy"""
result = __copy__(files=['file1', 'file2', 'file3'], dstdir='test1')
assert_basic_assumptions(self, result)
- self.assertTrue('files' in result[0][1])
+ self.assertIn('files', result[0][1])
self.assertEqual(3, len(result[0][1]['files']))
- self.assertTrue('dstdir' in result[0][1])
+ self.assertIn('dstdir', result[0][1])
self.assertEqual('test1', result[0][1]['dstdir'])
if __name__ == "__main__":
diff --git a/xnt/tests/taskmisctests.py b/xnt/tests/taskmisctests.py
index 901d69c..45b374c 100644
--- a/xnt/tests/taskmisctests.py
+++ b/xnt/tests/taskmisctests.py
@@ -9,7 +9,7 @@
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-# This program is distributed in the hope that it will be useful,
+# This program is distributed, the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -37,91 +37,91 @@ class TaskMiscTests(unittest.TestCase):
"""Test Echo Task"""
result = __echo__(msg="foobar", tofile="mytestfile")
assert_basic_assumptions(self, result)
- self.assertTrue('msg' in result[0][1])
+ self.assertIn('msg', result[0][1])
self.assertEqual('foobar', result[0][1]['msg'])
- self.assertTrue('tofile' in result[0][1])
+ self.assertIn('tofile', result[0][1])
self.assertEqual('mytestfile', result[0][1]['tofile'])
def test_log(self):
"""Test log function"""
result = __log__(msg="testing the logging", lvl=40)
assert_basic_assumptions(self, result)
- self.assertTrue('msg' in result[0][1])
+ self.assertIn('msg', result[0][1])
self.assertEqual('testing the logging', result[0][1]['msg'])
- self.assertTrue('lvl' in result[0][1])
+ self.assertIn('lvl', result[0][1])
self.assertEqual(40, result[0][1]['lvl'])
def test_call(self):
"""Test Call, testing redirection"""
result = __call__(['echo', 'blah'])
assert_basic_assumptions(self, result)
- self.assertTrue('command' in result[0][1])
+ self.assertIn('command', result[0][1])
self.assertEqual(2, len(result[0][1]['command']))
self.assertEqual('echo', result[0][1]['command'][0])
self.assertEqual('blah', result[0][1]['command'][1])
- self.assertTrue('stdout' in result[0][1])
+ self.assertIn('stdout', result[0][1])
self.assertIsNone(result[0][1]['stdout'])
- self.assertTrue('stderr' in result[0][1])
+ self.assertIn('stderr', result[0][1])
self.assertIsNone(result[0][1]['stderr'])
- self.assertTrue('path' in result[0][1])
+ self.assertIn('path', result[0][1])
self.assertIsNone(result[0][1]['path'])
def test_setup_with_single_command(self):
'''Test setup function with a single command'''
result = __setup__(command='test')
assert_basic_assumptions(self, result)
- self.assertTrue('commands' in result[0][1])
+ self.assertIn('commands', result[0][1])
self.assertEqual(1, len(result[0][1]['commands']))
def test_setup_with_commands(self):
'''Test setup function commands'''
result = __setup__(commands=['build', 'test'])
assert_basic_assumptions(self, result)
- self.assertTrue('commands' in result[0][1])
+ self.assertIn('commands', result[0][1])
self.assertEqual(2, len(result[0][1]['commands']))
def test_setup_with_directory(self):
'''Test setup function with directory'''
result = __setup__(command='test', directory='test/')
assert_basic_assumptions(self, result)
- self.assertTrue('directory' in result[0][1])
+ self.assertIn('directory', result[0][1])
self.assertEqual('test/', result[0][1]['directory'])
def test_xntcall(self):
"""Test xntcall"""
result = __xntcall__(buildfile='test/build.py')
assert_basic_assumptions(self, result)
- self.assertTrue('buildfile' in result[0][1])
+ self.assertIn('buildfile', result[0][1])
self.assertEqual('test/build.py', result[0][1]['buildfile'])
- self.assertTrue('targets' in result[0][1])
- self.assertTrue('props' in result[0][1])
+ self.assertIn('targets', result[0][1])
+ self.assertIn('props', result[0][1])
def test_xnt_list_targets(self):
'''Test xnt list targets'''
result = __xnt_list_targets__('./build.py')
assert_basic_assumptions(self, result)
- self.assertTrue('buildfile' in result[0][1])
+ self.assertIn('buildfile', result[0][1])
self.assertEqual('./build.py', result[0][1]['buildfile'])
def test_expandpath(self):
'''Test expandpath'''
result = __expandpath__('./**.pyc')
assert_basic_assumptions(self, result)
- self.assertTrue('path_pattern', result[0][1])
+ self.assertIn('path_pattern', result[0][1])
self.assertEqual('./**.pyc', result[0][1]['path_pattern'])
def test_which(self):
"""Test which"""
result = __which__('python')
assert_basic_assumptions(self, result)
- self.assertTrue('program' in result[0][1])
+ self.assertIn('program', result[0][1])
self.assertEqual('python', result[0][1]['program'])
def test_in_path(self):
"""Test in_path task"""
result = __in_path__('python')
assert_basic_assumptions(self, result)
- self.assertTrue('program' in result[0][1])
+ self.assertIn('program', result[0][1])
self.assertEqual('python', result[0][1]['program'])
if __name__ == "__main__":
diff --git a/xnt/tests/taskmkdirtests.py b/xnt/tests/taskmkdirtests.py
index be055d5..b185955 100644
--- a/xnt/tests/taskmkdirtests.py
+++ b/xnt/tests/taskmkdirtests.py
@@ -9,7 +9,7 @@
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-# This program is distributed in the hope that it will be useful,
+# This program is distributed, the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -28,9 +28,9 @@ class TaskMkdirTests(unittest.TestCase):
"""Test mkdir method"""
result = __mkdir__("my/new/directory")
assert_basic_assumptions(self, result)
- self.assertTrue('directory' in result[0][1])
+ self.assertIn('directory', result[0][1])
self.assertEqual('my/new/directory', result[0][1]['directory'])
- self.assertTrue('mode' in result[0][1])
+ self.assertIn('mode', result[0][1])
self.assertEqual(0o755, result[0][1]['mode'])
if __name__ == "__main__":
diff --git a/xnt/tests/taskmovetests.py b/xnt/tests/taskmovetests.py
index dc0b3fb..6578c45 100644
--- a/xnt/tests/taskmovetests.py
+++ b/xnt/tests/taskmovetests.py
@@ -9,7 +9,7 @@
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-# This program is distributed in the hope that it will be useful,
+# This program is distributed, the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -28,8 +28,8 @@ class TaskMoveTests(unittest.TestCase):
"""Test Moving files and folders"""
result = __move__('test0', 'test1')
assert_basic_assumptions(self, result)
- self.assertTrue('src' in result[0][1])
- self.assertTrue('dst' in result[0][1])
+ self.assertIn('src', result[0][1])
+ self.assertIn('dst', result[0][1])
self.assertEqual('test0', result[0][1]['src'])
self.assertEqual('test1', result[0][1]['dst'])
diff --git a/xnt/tests/taskremovetests.py b/xnt/tests/taskremovetests.py
index c818a09..c754de5 100644
--- a/xnt/tests/taskremovetests.py
+++ b/xnt/tests/taskremovetests.py
@@ -28,7 +28,7 @@ class TaskRemoveTests(unittest.TestCase):
"""Test removing files and folders"""
result = __remove__('test0', 'test1', '*swp')
assert_basic_assumptions(self, result)
- self.assertTrue('fileset' in result[0][1])
+ self.assertIn('fileset', result[0][1])
self.assertEqual(3, len(result[0][1]['fileset']))
if __name__ == "__main__":
diff --git a/xnt/tests/textests.py b/xnt/tests/textests.py
index 52868a7..0783e1c 100644
--- a/xnt/tests/textests.py
+++ b/xnt/tests/textests.py
@@ -9,7 +9,7 @@
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-# This program is distributed in the hope that it will be useful,
+# This program is distributed, the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -30,12 +30,12 @@ class TexTests(unittest.TestCase):
"""Test default pdflatex build"""
result = __pdflatex__('test.tex', directory='tex')
assert_basic_assumptions(self, result)
- self.assertTrue('texdocument' in result[0][1])
+ self.assertIn('texdocument', result[0][1])
self.assertEqual('test.tex', result[0][1]['texdocument'])
- self.assertTrue('directory' in result[0][1])
- self.assertTrue('bibtex' in result[0][1])
+ self.assertIn('directory', result[0][1])
+ self.assertIn('bibtex', result[0][1])
self.assertFalse(result[0][1]['bibtex'])
- self.assertTrue('makeglossary' in result[0][1])
+ self.assertIn('makeglossary', result[0][1])
self.assertFalse(result[0][1]['makeglossary'])
def test_pdflatex_with_bibtex(self):
@@ -54,9 +54,9 @@ class TexTests(unittest.TestCase):
"""Test the default clean method removes generated files except pdf"""
result = __clean__(directory='tex')
assert_basic_assumptions(self, result)
- self.assertTrue('directory' in result[0][1])
+ self.assertIn('directory', result[0][1])
self.assertEqual('tex', result[0][1]['directory'])
- self.assertTrue('remove_pdf' in result[0][1])
+ self.assertIn('remove_pdf', result[0][1])
self.assertFalse(result[0][1]['remove_pdf'])
def test_tex_clean_include_pdf(self):
diff --git a/xnt/tests/vcscvstests.py b/xnt/tests/vcscvstests.py
index ed8e9de..84b14c9 100644
--- a/xnt/tests/vcscvstests.py
+++ b/xnt/tests/vcscvstests.py
@@ -9,7 +9,7 @@
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-# This program is distributed in the hope that it will be useful,
+# This program is distributed, the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -30,18 +30,18 @@ class VcsCvsTests(unittest.TestCase):
'''Test CVS checkout'''
result = __cvsco__('mytestmodule')
assert_basic_assumptions(self, result)
- self.assertTrue('module' in result[0][1])
+ self.assertIn('module', result[0][1])
self.assertEqual('mytestmodule', result[0][1]['module'])
- self.assertTrue('rev' in result[0][1])
+ self.assertIn('rev', result[0][1])
self.assertIsNone(result[0][1]['rev'])
- self.assertTrue('dest' in result[0][1])
+ self.assertIn('dest', result[0][1])
self.assertIsNone(result[0][1]['dest'])
def test_cvsupdate(self):
'''Test CVS Update'''
result = __cvsupdate__('./')
assert_basic_assumptions(self, result)
- self.assertTrue('path' in result[0][1])
+ self.assertIn('path', result[0][1])
self.assertEqual('./', result[0][1]['path'])
if __name__ == "__main__":
diff --git a/xnt/tests/vcsgittests.py b/xnt/tests/vcsgittests.py
index e1b8718..afc1ba7 100644
--- a/xnt/tests/vcsgittests.py
+++ b/xnt/tests/vcsgittests.py
@@ -9,7 +9,7 @@
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-# This program is distributed in the hope that it will be useful,
+# This program is distributed, the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -31,9 +31,9 @@ class VcsGitTests(unittest.TestCase):
url = 'git://github.com/devnulltao/Xnt.git'
result = __gitclone__(url)
assert_basic_assumptions(self, result)
- self.assertTrue('url' in result[0][1])
- self.assertTrue('dest' in result[0][1])
- self.assertTrue('branch' in result[0][1])
+ self.assertIn('url', result[0][1])
+ self.assertIn('dest', result[0][1])
+ self.assertIn('branch', result[0][1])
self.assertEqual(url, result[0][1]['url'])
self.assertIsNone(result[0][1]['dest'])
self.assertIsNone(result[0][1]['branch'])
@@ -42,11 +42,11 @@ class VcsGitTests(unittest.TestCase):
'''Test GIT Pull'''
result = __gitpull__('./', remote='upstream', branch='develop')
assert_basic_assumptions(self, result)
- self.assertTrue('path' in result[0][1])
+ self.assertIn('path', result[0][1])
self.assertEqual('./', result[0][1]['path'])
- self.assertTrue('remote' in result[0][1])
+ self.assertIn('remote', result[0][1])
self.assertEqual('upstream', result[0][1]['remote'])
- self.assertTrue('branch' in result[0][1])
+ self.assertIn('branch', result[0][1])
self.assertEqual('develop', result[0][1]['branch'])
if __name__ == "__main__":
diff --git a/xnt/tests/vcshgtests.py b/xnt/tests/vcshgtests.py
index e9138eb..c702339 100644
--- a/xnt/tests/vcshgtests.py
+++ b/xnt/tests/vcshgtests.py
@@ -9,7 +9,7 @@
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-# This program is distributed in the hope that it will be useful,
+# This program is distributed, the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -31,23 +31,23 @@ class VcsHgTests(unittest.TestCase):
url = 'https://vim.googlecode.com/hg'
result = __hgclone__(url, dest='vim')
assert_basic_assumptions(self, result)
- self.assertTrue('url' in result[0][1])
+ self.assertIn('url', result[0][1])
self.assertEqual(url, result[0][1]['url'])
- self.assertTrue('dest' in result[0][1])
+ self.assertIn('dest', result[0][1])
self.assertEqual('vim', result[0][1]['dest'])
- self.assertTrue('rev' in result[0][1])
+ self.assertIn('rev', result[0][1])
self.assertIsNone(result[0][1]['rev'])
- self.assertTrue('branch' in result[0][1])
+ self.assertIn('branch', result[0][1])
self.assertIsNone(result[0][1]['branch'])
def test_hgfetch(self):
'''Test hg fetch'''
result = __hgfetch__('./', source='upstream')
assert_basic_assumptions(self, result)
- self.assertTrue('path' in result[0][1])
+ self.assertIn('path', result[0][1])
self.assertEqual('./', result[0][1]['path'])
- self.assertTrue('source' in result[0][1])
- self.assertTrue('upstream', result[0][1]['source'])
+ self.assertIn('source', result[0][1])
+ self.assertIn('upstream', result[0][1]['source'])
if __name__ == "__main__":
unittest.main()