Ejemplo n.º 1
0
 def _add_notes_file(self, slug="slug", commit=True, legacy=False, contents="i-am-also-a-template"):
     n = self.get_note_num()
     if legacy:
         basename = "%016x-%s.yaml" % (n, slug)
     else:
         basename = "%s-%016x.yaml" % (slug, n)
     filename = os.path.join(self.reporoot, "releasenotes", "notes", basename)
     create._make_note_file(filename, contents)
     self.repo.commit("add %s" % basename)
     return os.path.join("releasenotes", "notes", basename)
Ejemplo n.º 2
0
 def _add_notes_file(self, slug='slug', commit=True, legacy=False):
     n = self.get_note_num()
     if legacy:
         basename = '%016x-%s.yaml' % (n, slug)
     else:
         basename = '%s-%016x.yaml' % (slug, n)
     filename = os.path.join(self.reporoot, 'releasenotes', 'notes',
                             basename)
     create._make_note_file(filename)
     self._git_commit('add %s' % basename)
     return os.path.join('releasenotes', 'notes', basename)
Ejemplo n.º 3
0
 def _add_notes_file(self, slug='slug', commit=True, legacy=False):
     n = self.get_note_num()
     if legacy:
         basename = '%016x-%s.yaml' % (n, slug)
     else:
         basename = '%s-%016x.yaml' % (slug, n)
     filename = os.path.join(self.reporoot, 'releasenotes', 'notes',
                             basename)
     create._make_note_file(filename)
     self._git_commit('add %s' % basename)
     return os.path.join('releasenotes', 'notes', basename)
Ejemplo n.º 4
0
 def test_create_from_template(self):
     filename = create._pick_note_file_name(self.tmpdir, 'theslug')
     create._make_note_file(filename, 'i-am-a-template')
     with open(filename, 'r') as f:
         body = f.read()
     self.assertEqual('i-am-a-template', body)
Ejemplo n.º 5
0
 def test_create_from_template(self):
     filename = create._pick_note_file_name(self.tmpdir, 'theslug')
     create._make_note_file(filename)
     with open(filename, 'r') as f:
         body = f.read()
     self.assertEqual(create._TEMPLATE, body)