コード例 #1
0
class InternalIdMapperTest(unittest.TestCase):
    """
    Tests for `InternalIdMapper`.
    """
    _INTERNAL_IDS = [123, 456, 789]

    def setUp(self):
        self._mapper = MockInternalIdMapper()

    def test_get_by_id_with_value(self):
        self._mapper.get_by_id(InternalIdMapperTest._INTERNAL_IDS[0])
        self._mapper._get_by_property_value_sequence.assert_called_once_with(
            Property.INTERNAL_ID, [InternalIdMapperTest._INTERNAL_IDS[0]])

    def test_get_by_id_with_list(self):
        self._mapper.get_by_id(InternalIdMapperTest._INTERNAL_IDS)
        self._mapper._get_by_property_value_sequence.assert_called_once_with(
            Property.INTERNAL_ID, InternalIdMapperTest._INTERNAL_IDS)
コード例 #2
0
class InternalIdMapperTest(unittest.TestCase):
    """
    Tests for `InternalIdMapper`.
    """
    _INTERNAL_IDS = [123, 456, 789]

    def setUp(self):
        self._mapper = MockInternalIdMapper()

    def test_get_by_id_with_value(self):
        self._mapper.get_by_id(InternalIdMapperTest._INTERNAL_IDS[0])
        self._mapper._get_by_property_value_sequence.assert_called_once_with(
            Property.INTERNAL_ID, [InternalIdMapperTest._INTERNAL_IDS[0]])

    def test_get_by_id_with_list(self):
        self._mapper.get_by_id(InternalIdMapperTest._INTERNAL_IDS)
        self._mapper._get_by_property_value_sequence.assert_called_once_with(
            Property.INTERNAL_ID, InternalIdMapperTest._INTERNAL_IDS)
コード例 #3
0
 def setUp(self):
     self._mapper = MockInternalIdMapper()
コード例 #4
0
 def setUp(self):
     self._mapper = MockInternalIdMapper()