Adding tests for unimplemented features 08/6108/2 v4.0.0 v4.0.1
authorEduardo Sousa <eduardosousa@av.it.pt>
Wed, 9 May 2018 18:42:00 +0000 (19:42 +0100)
committerEduardo Sousa <eduardosousa@av.it.pt>
Mon, 14 May 2018 13:19:40 +0000 (14:19 +0100)
Helps to detect when certain feature was implemented but a test
is not in place to verify it.

Change-Id: I7a98036c94117b867206dd8c4cc87fa8cfd1eafb
Signed-off-by: Eduardo Sousa <eduardosousa@av.it.pt>
osm_common/tests/test_dbmemory.py
osm_common/tests/test_fslocal.py
osm_common/tests/test_msgbase.py

index 55c900f..a11dc1a 100644 (file)
@@ -62,6 +62,9 @@ def test_db_connect():
     assert db.logger == logging.getLogger(logger_name)
     assert len(db.db) == 0
 
+def test_db_disconnect(db_memory):
+    db_memory.db_disconnect()
+
 @pytest.mark.parametrize("table, filter", [
     ("test", {}),
     ("test", {"_id": 1}),
index 77886d8..2cc7aec 100644 (file)
@@ -62,6 +62,15 @@ def test_constructor_with_logger():
     assert fs.logger == logging.getLogger(logger_name)
     assert fs.path is None
 
+def test_get_params(fs_local):
+    params = fs_local.get_params()
+
+    assert len(params) == 2
+    assert "fs" in params
+    assert "path" in params
+    assert params["fs"] == "local"
+    assert params["path"] == valid_path()
+
 @pytest.mark.parametrize("config, exp_logger, exp_path", [
     ({'logger_name': 'fs_local', 'path': valid_path()}, 'fs_local', valid_path()),
     ({'logger_name': 'fs_local', 'path': valid_path()[:-1]}, 'fs_local', valid_path()),
@@ -86,6 +95,9 @@ def test_fs_connect_with_invalid_path(config, exp_exception_message):
         fs.fs_connect(config)
     assert str(excinfo.value) == exp_exception_message
 
+def test_fs_disconnect(fs_local):
+    fs_local.fs_disconnect()
+
 def test_mkdir_with_valid_path(fs_local):
     folder_name = str(uuid.uuid4())
     folder_path = valid_path() + folder_name
index c3b9726..4db3997 100644 (file)
@@ -18,7 +18,7 @@ def test_constructor():
     assert isinstance(msgbase, MsgBase)
 
 def test_connect(msg_base):
-    msg_base.connect()
+    msg_base.connect(None)
 
 def test_disconnect(msg_base):
     msg_base.disconnect()