summaryrefslogtreecommitdiffhomepage
path: root/tests/04_test_submodules.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-09-05 19:14:32 +0300
committerGuido Günther <agx@sigxcpu.org>2013-09-10 09:21:15 +0200
commit92f29be10aef6efc009716b285e6235af75e2093 (patch)
tree0d0f2908a98fec832a09fbf5356587f98ea50e59 /tests/04_test_submodules.py
parentc222197b5dd767578c8777d97316761890083c54 (diff)
tests: use eq_ and ok_ from nose tools in submodule tests
For consistency and better assert error messages. Change-Id: Ie6502daac6cee0176db5f099b91803292c17ceea Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests/04_test_submodules.py')
-rw-r--r--tests/04_test_submodules.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/04_test_submodules.py b/tests/04_test_submodules.py
index c326f553..4a9ff399 100644
--- a/tests/04_test_submodules.py
+++ b/tests/04_test_submodules.py
@@ -49,7 +49,7 @@ def teardown():
def test_empty_has_submodules():
"""Test empty repo for submodules"""
- assert not repo.has_submodules()
+ ok_(not repo.has_submodules())
def _add_dummy_data(repo, msg):
@@ -61,7 +61,7 @@ def _add_dummy_data(repo, msg):
def test_add_files():
"""Add some dummy data"""
_add_dummy_data(repo, "initial commit")
- assert True
+ ok_(True)
def test_add_submodule_files():
@@ -70,7 +70,7 @@ def test_add_submodule_files():
os.chdir(submodule.dir)
_add_dummy_data(submodule.repo, "initial commit in submodule")
os.chdir(repodir)
- assert True
+ ok_(True)
def test_add_submodule():
@@ -80,23 +80,24 @@ def test_add_submodule():
def test_has_submodules():
"""Check for submodules"""
- assert repo.has_submodules()
+ ok_(repo.has_submodules())
def test_get_submodules():
"""Check for submodules list of (name, hash)"""
modules = repo.get_submodules("master")[0]
- assert modules[0] == 'test_submodule'
- assert len(modules[1]) == 40
+ eq_(modules[0] , 'test_submodule')
+ eq_(len(modules[1]) , 40)
def test_dump_tree():
"""Dump the repository and check if files exist"""
dumpdir = tmpdir.join("dump")
os.mkdir(dumpdir)
- assert buildpackage.dump_tree(repo, dumpdir, "master", True)
- assert os.path.exists(os.path.join(dumpdir, testfile_name))
- assert os.path.exists(os.path.join(dumpdir, submodules[0].name, testfile_name))
+ ok_(buildpackage.dump_tree(repo, dumpdir, "master", True))
+ ok_(os.path.exists(os.path.join(dumpdir, testfile_name)))
+ ok_(os.path.exists(os.path.join(dumpdir, submodules[0].name,
+ testfile_name)))
def test_create_tarballs():
@@ -131,10 +132,10 @@ def test_add_whitespace_submodule():
def test_get_more_submodules():
"""Check for submodules list of (name, hash)"""
module = repo.get_submodules("master")
- assert(len(module) == len(submodule_names))
+ eq_(len(module), len(submodule_names))
for module in repo.get_submodules("master"):
- assert len(module[1]) == 40
- assert os.path.basename(module[0]) in submodule_names
+ eq_(len(module[1]) , 40)
+ ok_(os.path.basename(module[0]) in submodule_names)
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: