예제 #1
0
 def setUp(self):
    # create fake tempdir with the structure
     self.temp_dir = tempfile.mkdtemp()
     self.site = s2site.Site(self.temp_dir)
     self.site.init_structure()
     self.ntg = random.randint(8,100)
     self.gpi= []
     for i in range(0,self.ntg):
         title = util.random_title()
         self.gpi.append( { 'slug': util.make_slug(title),
                       'title': title,
                       'date': util.random_date()}
                   )   
     self.epp = random.randint(5,self.ntg)
     self.correctnumpag = math.ceil(float(self.ntg)/self.epp)
예제 #2
0
 def setUp(self):
     # create fake tempdir with the structure
     self.temp_dir = tempfile.mkdtemp()
     self.site = s2site.Site(self.temp_dir)
     self.site.init_structure()
     self.ntg = random.randint(8, 100)
     self.gpi = []
     for i in range(0, self.ntg):
         title = util.random_title()
         self.gpi.append({
             'slug': util.make_slug(title),
             'title': title,
             'date': util.random_date()
         })
     self.epp = random.randint(5, self.ntg)
     self.correctnumpag = math.ceil(float(self.ntg) / self.epp)
예제 #3
0
 def setUp(self):
     # create fake tempdir with the structure
     self.temp_dir = tempfile.mkdtemp()
     self.s2 = s2site.Site(self.temp_dir)
     self.s2.init_structure()
     # create a bunch of fake pages
     pgs = []
     for i in range(0, 11):
         pg = util.make_slug(util.random_title())
         pgs.append(pg)
         pgfp = os.path.join(self.s2.dirs['source'], pg)
         os.mkdir(pgfp)
         fname = os.path.join(pgfp, pg) + '.s2md'
         fout = open(fname, 'w')
         fout.close()
     self.pages = pgs
예제 #4
0
 def setUp(self):
     # create fake tempdir with the structure
     self.temp_dir = tempfile.mkdtemp()
     self.s2 = s2site.Site(self.temp_dir)
     self.s2.init_structure()
     # create a bunch of fake pages
     pgs = []
     for i in range(0,11):
         pg = util.make_slug(util.random_title())
         pgs.append(pg)
         pgfp = os.path.join(self.s2.dirs['source'],pg)
         os.mkdir(pgfp)
         fname = os.path.join(pgfp,pg) + '.s2md'
         fout = open(fname,'w')
         fout.close()
     self.pages = pgs
예제 #5
0
def random_path(depth=3):
    pcs = []
    for i in range(0, depth + 1):
        pcs.append(util.make_slug(util.random_title()))
    rp = '/'.join(pcs)
    return rp
예제 #6
0
def random_path(depth=3):
    pcs = []
    for i in range(0,depth+1):
        pcs.append(util.make_slug(util.random_title()))
    rp = '/'.join(pcs)
    return rp