tests: return 0 instead of None for unknown file in test component class support...
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 13 Aug 2019 19:30:15 +0000 (15:30 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 14 Aug 2019 22:01:40 +0000 (18:01 -0400)
I noticed some spurious warnings while running
TestAutoDiscoverSourceComponentSpecsGrouping.test_grouping (shortened
for brevity):

    unexpected result type: component-class-name=source.test.TestSourceExt, input=/home/smarchi/src/babeltrace/tests/data/auto-source-discovery/grouping/bt_plugin_test.py, input-type=file, expected-types=REAL,MAP,SIGNED_INTEGER, actual-type=NULL

Indeed, the _query method of TestSourceExt fails to return a value (so
it returns None) if it doesn't know the file.  This is not on purpose in
this test, so fix it.

Change-Id: I303c78dae4a518c62573263aa7a3afafd0c61ed7
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1906
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
tests/data/auto-source-discovery/grouping/bt_plugin_test.py

index 2495b502099714a72eae152f367713d85cbb2b0a..a4d53dbd88d75b267badb2ed8b645e2698b69aaa 100644 (file)
@@ -76,8 +76,8 @@ class TestSourceExt(Base, bt2._UserSourceComponent, message_iterator_class=TestI
                         return 1
                     else:
                         return 1.0
-            else:
-                return 0
+
+            return 0
         else:
             raise bt2.UnknownObject
 
This page took 0.025364 seconds and 4 git commands to generate.