From fa070417395b29c153ea3577ea026623aaacfc80 Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Thu, 14 Mar 2019 17:37:42 +0100
Subject: [PATCH] [test][hash] Code cleanup

---
 beat/core/test/test_hash.py | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/beat/core/test/test_hash.py b/beat/core/test/test_hash.py
index 2723aef2..53853cb3 100644
--- a/beat/core/test/test_hash.py
+++ b/beat/core/test/test_hash.py
@@ -56,9 +56,9 @@ def test_block_output_hash():
         },
         "some_output",
     )
-    assert h is not None
-    assert isinstance(h, str)
-    assert len(h) > 0
+    nose.tools.assert_is_not_none(h)
+    nose.tools.assert_true(isinstance(h, str))
+    nose.tools.assert_true(len(h) > 0)
 
 
 # ----------------------------------------------------------
@@ -130,7 +130,7 @@ def test_different_block_output_hash():
         "output2",
     )
 
-    assert h1 != h2, "%r != %r" % (h1, h2)
+    nose.tools.assert_not_equal(h1, h2)
 
 
 # ----------------------------------------------------------
@@ -151,9 +151,9 @@ def test_analyzer_hash():
         },
     )
 
-    assert h is not None
-    assert isinstance(h, str)
-    assert len(h) > 0
+    nose.tools.assert_is_not_none(h)
+    nose.tools.assert_true(isinstance(h, str))
+    nose.tools.assert_true(len(h) > 0)
 
 
 # ----------------------------------------------------------
@@ -221,7 +221,7 @@ def test_different_analyzer_hash():
         },
     )
 
-    assert h1 != h2, "%r != %r" % (h1, h2)
+    nose.tools.assert_not_equal(h1, h2)
 
 
 # ----------------------------------------------------------
@@ -232,13 +232,13 @@ def test_path_from_hash():
     h = hash.hashDataset("some_database/1", "some_protocol", " some_set")
     path = hash.toPath(h)
 
-    assert path is not None
-    assert isinstance(path, str)
-    assert len(path) > 0
+    nose.tools.assert_is_not_none(path)
+    nose.tools.assert_true(isinstance(path, str))
+    nose.tools.assert_true(len(path) > 0)
 
     parts = path.split("/")
 
-    assert len(parts) > 1
+    nose.tools.assert_true(len(parts) > 1)
 
     for folder in parts[:-1]:
         nose.tools.eq_(len(folder), 2)
-- 
GitLab