class TestBatonCustomObjectMapper(unittest.TestCase): """ Tests for `BatonCustomObjectMapper`. """ def setUp(self): self.test_with_baton = TestWithBaton(baton_setup=BATON_SETUP) self.test_with_baton.setup() self.mapper = StubBatonCustomObjectMapper(self.test_with_baton.baton_location) self.mapper._object_deserialiser = MagicMock(wraps=self.mapper._object_deserialiser) def tearDown(self): self.test_with_baton.tear_down() def test_get_using_specific_query(self): results = self.mapper._get_with_prepared_specific_query(PreparedSpecificQuery("ls")) self.assertIsInstance(results, list) self.assertEqual(len(results), self.mapper._object_deserialiser.call_count)
def setUp(self): self.test_with_baton = TestWithBaton(baton_setup=BATON_SETUP) self.test_with_baton.setup() self.mapper = StubBatonCustomObjectMapper(self.test_with_baton.baton_location) self.mapper._object_deserialiser = MagicMock(wraps=self.mapper._object_deserialiser)