NETCONF: list instance queries should hit the ops tree as well

getItems() operates on config and operation data, not just on the config
data. It is possible that there are lists which only live in an ops data
subtree.

Change-Id: I0206290dfcc4c1ebe91b4728f8e7a9230fc387cb
diff --git a/tests/datastore_access.cpp b/tests/datastore_access.cpp
index 311b395..a6cadc3 100644
--- a/tests/datastore_access.cpp
+++ b/tests/datastore_access.cpp
@@ -17,6 +17,7 @@
 #else
 #error "Unknown backend"
 #endif
+#include "pretty_printers.hpp"
 #include "sysrepo_subscription.hpp"
 #include "utils.hpp"
 
@@ -27,6 +28,11 @@
     IMPLEMENT_MOCK3(write);
 };
 
+class MockDataSupplier : public trompeloeil::mock_interface<DataSupplier> {
+public:
+    IMPLEMENT_CONST_MOCK1(get_data);
+};
+
 TEST_CASE("setting/getting values")
 {
     trompeloeil::sequence seq1;
@@ -313,6 +319,23 @@
         REQUIRE(datastore.getItems("/example-schema:leafDecimal") == expected);
     }
 
+    SECTION("operational data")
+    {
+        MockDataSupplier mockOpsData;
+        OperationalDataSubscription opsDataSub("/example-schema:temperature", mockOpsData);
+        DatastoreAccess::Tree expected;
+        std::string xpath;
+        SECTION("temperature")
+        {
+            expected = {{"/example-schema:temperature", int32_t{22}}};
+            xpath = "/example-schema:temperature";
+        }
+
+        REQUIRE_CALL(mockOpsData, get_data(xpath)).RETURN(expected);
+        REQUIRE(datastore.getItems(xpath) == expected);
+    }
+
+
     waitForCompletionAndBitMore(seq1);
 }