Exemplo n.º 1
0
class KeyFixTestCase(unittest.TestCase):

	def setUp(self):
		self.t = self.assertTrue
		self.inst = self.assertIsInstance
		self.inserter = BulkInserter(host="localhost",port=27017,database="reddit_stream_test",collection="users")
	def tearDown(self):	
		self.inserter.source.drop()

	def test_keyfix_characters(self):
		count = 0
		for ind, user in enumerate(annotation.user_reader("data/test_key.json")):
			self.inserter.insert(item=user)
			count = ind
		self.inserter.send()
		count_2 = 0
		for ind, user in enumerate(self.inserter.source.find()):
			count_2 = ind
		self.t(count == count_2)
Exemplo n.º 2
0
	def setUp(self):
		self.t = self.assertTrue
		self.inst = self.assertIsInstance
		self.inserter = BulkInserter(host="localhost",port=27017,database="reddit_stream_test",collection="users")
Exemplo n.º 3
0
def main(argv):
    inserter = BulkInserter(source=Source(host="localhost", port=27017, database=argv[1], collection=argv[2]))
    for doc in annotation.sbr_reader(argv[0]):
        inserter.insert(item=doc)
    inserter.send()