def test_get_output_with_dict(self): output = {'merge': 'bla', 'db_alias': 'default'} collection = self.test_doc._get_collection() qs = QuerySet(self.test_doc, collection) ret = qs._get_output(output) self.assertIsInstance(ret, SON)
def test_get_output_with_str(self): collection = self.test_doc._get_collection() qs = QuerySet(self.test_doc, collection) ret = qs._get_output('outcoll') self.assertEqual(ret, 'outcoll')
def test_get_output_with_son(self): collection = self.test_doc._get_collection() qs = QuerySet(self.test_doc, collection) son = SON({'merge': 'bla'}) ret = qs._get_output(son) self.assertEqual(ret, son)
def test_get_output_with_bad_output_type(self): collection = self.test_doc._get_collection() qs = QuerySet(self.test_doc, collection) with self.assertRaises(ConfusionError): qs._get_output([])
def test_get_output_without_action_data(self): collection = self.test_doc._get_collection() qs = QuerySet(self.test_doc, collection) with self.assertRaises(OperationError): qs._get_output({})