def check_not_idfile(self, content, ans, mode='w'): # create ``_id`` file p = os.path.join(self.dir, '_id') with open(p, mode) as idfile: idfile.write(content) doc = LocalDoc(self.dir, create=False) assert doc.get_id() != ans, doc.get_id()
def test_dirname(self): ''' If the ``_id`` file does not eixsts ''' dirname = os.path.split(self.dir)[-1] doc = LocalDoc(self.dir, is_ddoc=False) assert doc.get_id() == dirname doc = LocalDoc(self.dir, is_ddoc=True) ans = '_design/{0}'.format(dirname) assert doc.get_id() == ans