Skip to content

Commit

Permalink
test that already passes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Dirolf committed Jul 6, 2009
1 parent 0bb1812 commit 76eb099
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/test_gridfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,27 @@
"""

import unittest
import threading
import sys
sys.path[0:0] = [""]

import gridfs
from test_connection import get_connection


class JustWrite(threading.Thread):

def __init__(self, fs):
threading.Thread.__init__(self)
self.fs = fs

def run(self):
for _ in range(100):
file = self.fs.open("test", "w")
file.write("hello")
file.close()


class TestGridfs(unittest.TestCase):

def setUp(self):
Expand Down Expand Up @@ -147,5 +161,10 @@ def test_remove_alt_coll(self):
self.assertEqual(self.db.pymongo_test.files.find().count(), 0)
self.assertEqual(self.db.pymongo_test.chunks.find().count(), 0)

def test_threading(self):
for i in range(10):
t = JustWrite(self.fs)
t.start()

if __name__ == "__main__":
unittest.main()

0 comments on commit 76eb099

Please sign in to comment.