kunit_tool: added tests for throw_error_if_not_subset()

Added tests to make sure method correctly throws exception if the first
param is not a subset of the second param.

Signed-off-by: Maria Del Carmen Ignacio <mariaignacio@google.com>
Signed-off-by: Darya Verzhbinsky <daryaver@google.com>
Change-Id: I651d96fbb8e59be03eba82bb2330336018493f6e
diff --git a/tools/testing/kunit/kunit_test.py b/tools/testing/kunit/kunit_test.py
index 135c0ee..e90cd7e 100755
--- a/tools/testing/kunit/kunit_test.py
+++ b/tools/testing/kunit/kunit_test.py
@@ -237,5 +237,19 @@
 		self.print_mock.assert_any_call(StrContains('i2c-aspeed'))
 		self.print_mock.assert_any_call(StrContains('aspeed_i2c'))
 
+class KUnitKernelTest(unittest.TestCase):
+	def test_not_subset_throw_exception(self):
+		supersetConfig = kunit_config.Kconfig()
+		subsetConfig = kunit_config.Kconfig()
+		subsetConfig.add_entry(kunit_config.KconfigEntry('CONFIG_TEST=y'))
+		with self.assertRaises(kunit_kernel.ConfigError):
+			kunit_kernel.throw_error_if_not_subset(supersetConfig, subsetConfig)
+
+	def test_not_subset_no_exception(self):
+		subsetConfig = kunit_config.Kconfig()
+		supersetConfig = kunit_config.Kconfig()
+		supersetConfig.add_entry(kunit_config.KconfigEntry('CONFIG_TEST=y'))
+		kunit_kernel.throw_error_if_not_subset(supersetConfig, subsetConfig)
+
 if __name__ == '__main__':
 	unittest.main()