# Copyright 2022 (c) Anna Schumaker. """Test that the gi.repository has been configured correctly.""" import unittest import emmental import gi class TestGSetup(unittest.TestCase): """GObject Introspection configuration test case.""" def test_require_version(self): """Check that gi.require_version() has been called.""" self.assertEqual(gi.get_required_version("Gtk"), "4.0") self.assertEqual(gi.get_required_version("Adw"), "1") def test_adw(self): """Check that libadwaita style has been set.""" style = gi.repository.Adw.StyleManager.get_default() self.assertEqual(style.get_color_scheme(), gi.repository.Adw.ColorScheme.DEFAULT) def test_import(self): """Check that modules have been imported.""" self.assertIsNotNone(emmental.gsetup.gi) def test_application_id(self): """Check that the application id is generated properly.""" self.assertEqual(emmental.gsetup.DEBUG_STR, "-debug") self.assertEqual(emmental.gsetup.APPLICATION_ID, "com.nowheycreamery.emmental-debug")