File: testutils.py

package info (click to toggle)
calypso 2.1-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 276 kB
  • sloc: python: 1,675; sh: 119; makefile: 4
file content (20 lines) | stat: -rw-r--r-- 579 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import shutil
import subprocess
import tempfile
import unittest

import calypso.config


class CalypsoTestCase(unittest.TestCase):

    def setUp(self):
        self.tmpdir = tempfile.mkdtemp()
        calypso.config.set('storage', 'folder', self.tmpdir)
        subprocess.call(["git", "init", self.tmpdir])
        subprocess.call(["git", "config", "user.email", "calypso@example.com"], cwd=self.tmpdir)
        subprocess.call(["git", "config", "user.name", "cal Ypso"], cwd=self.tmpdir)

    def tearDown(self):
        if self.tmpdir:
            shutil.rmtree(self.tmpdir)