def save_test(self, test_name, alternatives, steps):
        test = self.tests.find_one({'_id': test_name})

        if test and test['a'] != alternatives:
            raise Exception('test "%s" already exists with different alternatives' % test_name)

        elif not test:
            self.tests.save({
                '_id': test_name,
                'a': alternatives,
                's': steps,
            }, safe=True)
dataset/ETHPy150Open dcrosta/dabble/dabble/backends/mongodb.py/MongoResultStorage.save_test/original