diff options
Diffstat (limited to 'libs/plugin_python/tests/python/test_filetree.cpp')
| -rw-r--r-- | libs/plugin_python/tests/python/test_filetree.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libs/plugin_python/tests/python/test_filetree.cpp b/libs/plugin_python/tests/python/test_filetree.cpp new file mode 100644 index 0000000..cce43cf --- /dev/null +++ b/libs/plugin_python/tests/python/test_filetree.cpp @@ -0,0 +1,22 @@ +#include "pybind11_qt/pybind11_qt.h" + +#include <pybind11/functional.h> +#include <pybind11/pybind11.h> + +#include <uibase/ifiletree.h> + +using namespace MOBase; + +PYBIND11_MODULE(filetree, m) +{ + // test the FileTypes stuff + m.def("is_file", [](IFileTree::FileTypes const& t) { + return t.testFlag(IFileTree::FILE); + }); + m.def("is_directory", [](IFileTree::FileTypes const& t) { + return t.testFlag(IFileTree::DIRECTORY); + }); + m.def("value", [](IFileTree::FileTypes const& t) { + return t.toInt(); + }); +} |
