Esempio n. 1
0
	def test_dump_to_bson_dumps(self):
		if os.path.exists(os.path.dirname(os.path.abspath(__file__))+'/data/output.bson'):
			os.remove(os.path.dirname(os.path.abspath(__file__))+'/data/output.bson')

		output_path = os.path.dirname(os.path.realpath(__file__)) + '/' + 'data/output.bson'
		collection = BsonCollection(os.path.dirname(os.path.realpath(__file__)) +'/'+ config['bson']['valid'])
		collection.dump_to_bson(output_path)
		self.assertTrue(os.path.getsize(output_path) > 0)

		if os.path.exists(os.path.dirname(os.path.abspath(__file__))+'/data/output.bson'):
			os.remove(os.path.dirname(os.path.abspath(__file__))+'/data/output.bson')
Esempio n. 2
0
    def test_dump_to_bson_dumps(self):
        if os.path.exists(
                os.path.dirname(os.path.abspath(__file__)) +
                '/data/output.bson'):
            os.remove(
                os.path.dirname(os.path.abspath(__file__)) +
                '/data/output.bson')

        output_path = os.path.dirname(
            os.path.realpath(__file__)) + '/' + 'data/output.bson'
        collection = BsonCollection(
            os.path.dirname(os.path.realpath(__file__)) + '/' +
            config['bson']['valid'])
        collection.dump_to_bson(output_path)
        self.assertTrue(os.path.getsize(output_path) > 0)

        if os.path.exists(
                os.path.dirname(os.path.abspath(__file__)) +
                '/data/output.bson'):
            os.remove(
                os.path.dirname(os.path.abspath(__file__)) +
                '/data/output.bson')