diff --git a/tests/utests/CMakeLists.txt b/tests/utests/CMakeLists.txt
index ca5c5b5..c236413 100644
--- a/tests/utests/CMakeLists.txt
+++ b/tests/utests/CMakeLists.txt
@@ -5,6 +5,7 @@
     utest:test_context
     utest:test_xml
     utest:test_xpath
+    utest:test_yanglib
     utest:schema/test_schema
     utest:schema/test_parser_yang
     utest:schema/test_parser_yin
@@ -37,6 +38,7 @@
     " "
     " "
     " "
+    " "
     " ")
 set(tests ${tests} ${local_tests} PARENT_SCOPE)
 set(tests_wraps ${tests_wraps} ${local_tests_wraps} PARENT_SCOPE)
diff --git a/tests/utests/test_yanglib.c b/tests/utests/test_yanglib.c
new file mode 100644
index 0000000..eb35cff
--- /dev/null
+++ b/tests/utests/test_yanglib.c
@@ -0,0 +1,214 @@
+/**
+ * @file test_yanglib.c
+ * @author: Michal Vasko <mvasko@cesnet.cz>
+ * @brief unit tests for ietf-yang-library data
+ *
+ * Copyright (c) 2020 CESNET, z.s.p.o.
+ *
+ * This source code is licensed under BSD 3-Clause License (the "License").
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://opensource.org/licenses/BSD-3-Clause
+ */
+
+#include "tests/config.h"
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <cmocka.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include "../../src/context.h"
+#include "../../src/tree_schema.h"
+
+#define BUFSIZE 1024
+char logbuf[BUFSIZE] = {0};
+int store = -1; /* negative for infinite logging, positive for limited logging */
+
+struct ly_ctx *ctx; /* context for tests */
+
+/* set to 0 to printing error messages to stderr instead of checking them in code */
+#define ENABLE_LOGGER_CHECKING 1
+
+#if ENABLE_LOGGER_CHECKING
+static void
+logger(LY_LOG_LEVEL level, const char *msg, const char *path)
+{
+    (void) level; /* unused */
+    if (store) {
+        if (path && path[0]) {
+            snprintf(logbuf, BUFSIZE - 1, "%s %s", msg, path);
+        } else {
+            strncpy(logbuf, msg, BUFSIZE - 1);
+        }
+        if (store > 0) {
+            --store;
+        }
+    }
+}
+#endif
+
+static LY_ERR
+test_imp_clb(const char *mod_name, const char *mod_rev, const char *submod_name, const char *sub_rev, void *user_data,
+             LYS_INFORMAT *format, const char **module_data, void (**free_module_data)(void *model_data, void *user_data))
+{
+    const char *schema_a_sub =
+    "submodule a_sub {"
+        "belongs-to a {"
+            "prefix a;"
+        "}"
+        "yang-version 1.1;"
+
+        "feature feat1;"
+
+        "list l3 {"
+            "key \"a\";"
+            "leaf a {"
+                "type uint16;"
+            "}"
+            "leaf b {"
+                "type uint16;"
+            "}"
+        "}"
+    "}";
+
+    assert_string_equal(mod_name, "a");
+    assert_null(mod_rev);
+    if (!submod_name) {
+        return LY_ENOTFOUND;
+    }
+    assert_string_equal(submod_name, "a_sub");
+    assert_null(sub_rev);
+    assert_null(user_data);
+
+    *format = LYS_IN_YANG;
+    *module_data = schema_a_sub;
+    *free_module_data = NULL;
+    return LY_SUCCESS;
+}
+
+static int
+setup(void **state)
+{
+    (void) state; /* unused */
+
+    const char *schema_a =
+    "module a {"
+        "namespace urn:tests:a;"
+        "prefix a;"
+        "yang-version 1.1;"
+
+        "include a_sub;"
+
+        "list l2 {"
+            "key \"a\";"
+            "leaf a {"
+                "type uint16;"
+            "}"
+            "leaf b {"
+                "type uint16;"
+            "}"
+        "}"
+    "}";
+    const char *schema_b =
+    "module b {"
+        "namespace urn:tests:b;"
+        "prefix b;"
+        "yang-version 1.1;"
+
+        "import a {"
+            "prefix a;"
+        "}"
+
+        "deviation /a:l2 {"
+            "deviate add {"
+                "max-elements 40;"
+            "}"
+        "}"
+
+        "leaf foo {"
+            "type string;"
+        "}"
+    "}";
+    const struct lys_module *mod;
+
+#if ENABLE_LOGGER_CHECKING
+    ly_set_log_clb(logger, 1);
+#endif
+
+    assert_int_equal(LY_SUCCESS, ly_ctx_new(TESTS_DIR_MODULES_YANG, 0, &ctx));
+    ly_ctx_set_module_imp_clb(ctx, test_imp_clb, NULL);
+
+    mod = lys_parse_mem(ctx, schema_a, LYS_IN_YANG);
+    assert_non_null(mod);
+    assert_int_equal(LY_SUCCESS, lys_feature_enable(mod, "feat1"));
+    assert_non_null(lys_parse_mem(ctx, schema_b, LYS_IN_YANG));
+
+    return 0;
+}
+
+static int
+teardown(void **state)
+{
+#if ENABLE_LOGGER_CHECKING
+    if (*state) {
+        fprintf(stderr, "%s\n", logbuf);
+    }
+#else
+    (void) state; /* unused */
+#endif
+
+    ly_ctx_destroy(ctx, NULL);
+    ctx = NULL;
+
+    return 0;
+}
+
+void
+logbuf_clean(void)
+{
+    logbuf[0] = '\0';
+}
+
+#if ENABLE_LOGGER_CHECKING
+#   define logbuf_assert(str) assert_string_equal(logbuf, str)
+#else
+#   define logbuf_assert(str)
+#endif
+
+static void
+test_yanglib(void **state)
+{
+    *state = test_yanglib;
+
+    struct lyd_node *tree;
+    struct ly_set *set;
+    LY_ERR ret;
+
+    tree = ly_ctx_get_yanglib_data(ctx);
+    assert_non_null(tree);
+
+    /* make sure there is "a" with a submodule and deviation */
+    ret = lyd_find_xpath(tree, "/ietf-yang-library:yang-library/module-set/module[name='a'][submodule/name='a_sub']"
+                         "[feature='feat1'][deviation='b']", &set);
+    assert_int_equal(ret, LY_SUCCESS);
+
+    assert_int_equal(set->count, 1);
+    ly_set_free(set, NULL);
+
+    lyd_free_all(tree);
+    *state = NULL;
+}
+
+int main(void)
+{
+    const struct CMUnitTest tests[] = {
+        cmocka_unit_test_setup_teardown(test_yanglib, setup, teardown),
+    };
+
+    return cmocka_run_group_tests(tests, NULL, NULL);
+}
