Example #1
0
 def setUp(self):
     self.path = os.path.join(TMPDIR, 'delete')
     self.config = config.Manager(id='test', path=self.path)
     template = {
         'string': 'string',
         'list': [],
         'dict': {},
         'integer': 1,
         'boolean': True,
         'date': dt.datetime.now(),
         'float': 0.5,
         'data': plistlib.Data('data')
     }
     self.config.write(template)
Example #2
0
 def setUp(self):
     cls = self.__class__
     self.path = os.path.join(TMPDIR, 'read-and-write')
     self.config = config.Manager(id='test', path=self.path)
Example #3
0
 def test_path_exists_as_file_fails(self):
     with self.assertRaises(TypeError):
         conf = config.Manager('test2', path=self.file)
Example #4
0
 def test_init_creates_missing_path(self):
     os.removedirs(self.path)
     self.assertFalse(os.path.exists(self.path))
     conf = config.Manager(id='test2', path=self.path)
     self.assertTrue(os.path.exists(self.path))
Example #5
0
 def setUp(self):
     self.path = os.path.join(TMPDIR, 'locking')
     self.config = config.Manager(id='test', path=self.path, timeout=0)
     self.config.write({})
     self.lock = config.FileLock(self.config.lockfile, timeout=1)
Example #6
0
 def setUp(self):
     cls = self.__class__
     self.file = cls.file
     self.path = os.path.join(TMPDIR, 'init')
     self.config = config.Manager(id='init_test', path=self.path)
Example #7
0
 def setUp(self):
     self.path = os.path.join(TMPDIR, 'threaded')
     self.config = config.Manager(id='test', path=self.path)
     self.config.write({})
     self.config2 = config.Manager(id='test', path=self.path)
     self.config3 = config.Manager(id='test', path=self.path)
Example #8
0
 def setUp(self):
     self.path = os.path.join(TMPDIR, 'setdefault')
     self.config = config.Manager(id='test', path=self.path)
     self.config.write({})
Example #9
0
 def setUp(self):
     self.path = os.path.join(TMPDIR, 'add')
     self.config = config.Manager(id='test', path=self.path)
Example #10
0
 def setUp(self):
     self.path = os.path.join(TMPDIR, 'delete')
     self.config = config.Manager(id='test', path=self.path)
     self.config.write({'key': 'value'})