# Copyright (c) 2022, JINGROW and Contributors
# License: MIT. See LICENSE
import jingrow
from jingrow.config import get_modules_from_all_apps_for_user
from jingrow.tests.utils import JingrowTestCase


class TestConfig(JingrowTestCase):
	def test_get_modules(self):
		jingrow_modules = jingrow.get_all("Module Def", filters={"app_name": "jingrow"}, pluck="name")
		all_modules_data = get_modules_from_all_apps_for_user()
		all_modules = [x["module_name"] for x in all_modules_data]
		self.assertIsInstance(all_modules_data, list)
		self.assertFalse([x for x in jingrow_modules if x not in all_modules])
