Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Feb 7, 2011
1 parent faba17c commit 81f3a87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion couchdbkit/ext/pylons/test.py
@@ -1,8 +1,11 @@
from __future__ import with_statement

import os
import unittest

from couchdbkit import BaseDocsLoader, ResourceNotFound
from couchdbkit.ext.pylons.db import init_db, sync_design, default_design_path
import os, json, unittest
from couchdbkit.utils import json

class FixtureLoader(BaseDocsLoader):
def __init__(self, directory):
Expand Down
8 changes: 3 additions & 5 deletions tests/test_loaders.py
Expand Up @@ -20,11 +20,7 @@
class LoaderTestCase(unittest.TestCase):

def setUp(self):
f, fname = tempfile.mkstemp()
os.unlink(fname)
self.tempdir = fname
os.makedirs(self.tempdir)

self.tempdir = tempfile.mkdtemp()
self.template_dir = os.path.join(os.path.dirname(__file__), 'data/app-template')
self.app_dir = os.path.join(self.tempdir, "couchdbkit-test")
shutil.copytree(self.template_dir, self.app_dir)
Expand All @@ -39,6 +35,8 @@ def tearDown(self):
os.remove(os.path.join(root, name))
for name in dirs:
os.rmdir(os.path.join(root, name))

os.rmdir(self.tempdir)
del self.server['couchdbkit_test']

def testGetDoc(self):
Expand Down

0 comments on commit 81f3a87

Please sign in to comment.