def setUp(self): self.origdir = os.getcwd() self.tmpdir = tempfile.mkdtemp() self.name = gitrelease.name_get() self.wdir = pjoin(self.tmpdir, self.name) shutil.copytree('.', self.wdir) os.chdir(self.wdir) null = open('/dev/null', 'w') for tag in subprocess.check_output(['git', 'tag'])\ .decode('utf-8')\ .split('\n'): if tag != '': subprocess.check_call(['git', 'tag', '-d', tag], stdout=null) null.close()
def test_name_get(self): self.assertEqual(gitrelease.name_get(), 'git-release')