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)
def setUp(self): cls = self.__class__ self.path = os.path.join(TMPDIR, 'read-and-write') self.config = config.Manager(id='test', path=self.path)
def test_path_exists_as_file_fails(self): with self.assertRaises(TypeError): conf = config.Manager('test2', path=self.file)
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))
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)
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)
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)
def setUp(self): self.path = os.path.join(TMPDIR, 'setdefault') self.config = config.Manager(id='test', path=self.path) self.config.write({})
def setUp(self): self.path = os.path.join(TMPDIR, 'add') self.config = config.Manager(id='test', path=self.path)
def setUp(self): self.path = os.path.join(TMPDIR, 'delete') self.config = config.Manager(id='test', path=self.path) self.config.write({'key': 'value'})