示例#1
0
 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)
示例#2
0
 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()
示例#3
0
 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)
示例#4
0
 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)
示例#5
0
 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)
示例#6
0
 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)
示例#7
0
 def setUp(self):
     self.path = TMPDIR / 'jamf.config.test.plist'
     self.config = config.Config(path=self.path)
示例#8
0
 def setUp(self):
     """
     create config with cusomt path for each test
     """
     self.config = config.Config(path=PREFERENCES)