def test_default_global_with_path_kwarg(self): """ test default config.PREFERENCES with path=None uses global """ test = config.Config(path=self.altpath) self.assertEqual(test.path, self.altpath) self.assertNotEqual(test.path, config.PREFERENCES)
def test_modified_global_as_None_without_path(self): """ test config.PREFERENCES = None and path=None raises TypeError """ config.PREFERENCES = None with self.assertRaises(TypeError): test = config.Config()
def test_modified_default_with_path_kwarg(self): """ test specified path overrides config.PREFERENCES """ test = config.Config(path=self.altpath) self.assertEqual(test.path, self.altpath) self.assertNotEqual(test.path, config.PREFERENCES)
def test_modified_global_with_None(self): """ test explicit path kwarg as None uses modified config.PREFERENCES """ config.PREFERENCES = self.altpath test = config.Config(path=None) self.assertEqual(test.path, config.PREFERENCES)
def test_modified_global_without_kwarg(self): """ test missing path kwarg uses modified config.PREFERENCES """ config.PREFERENCES = self.altpath test = config.Config() self.assertEqual(test.path, config.PREFERENCES)
def test_default_global_with_path_as_None(self): """ test config.PREFERENCES is used when path=None """ test = config.Config(path=None) self.assertEqual(test.path, config.PREFERENCES)
def setUp(self): self.path = TMPDIR / 'jamf.config.test.plist' self.config = config.Config(path=self.path)
def setUp(self): """ create config with cusomt path for each test """ self.config = config.Config(path=PREFERENCES)