def test_write_record_new(self):
        """Test that we can create a new record."""
        entity = PipelineEntity.get_mock_object()

        PipelineRepository.write_record(PipelineMapper.to_record(entity))

        pipeline = PipelineRepository.fetch_pipeline_by_id(entity.id)
        self.assertEquals(pipeline.name, entity.name)
    def test_write_record_new(self):
        """Test that we can create a new record."""
        entity = PipelineEntity.get_mock_object()

        PipelineRepository.write_record(
            PipelineMapper.to_record(entity)
        )

        pipeline = PipelineRepository.fetch_pipeline_by_id(entity.id)
        self.assertEquals(pipeline.name, entity.name)
    def test_write_pipeline(self):
        """Test that the provided entity gets written to the repository."""
        entity = PipelineEntity.get_mock_object()

        with self.assertRaises(ResourceNotFoundException):
            PipelineService.fetch_pipeline_by_id(entity.id)

        PipelineService.write_pipeline(entity)

        self.assertEquals(
            PipelineService.fetch_pipeline_by_id(entity.id),
            entity,
        )
示例#4
0
    def test_write_pipeline(self):
        """Test that the provided entity gets written to the repository."""
        entity = PipelineEntity.get_mock_object()

        with self.assertRaises(ResourceNotFoundException):
            PipelineService.fetch_pipeline_by_id(entity.id)

        PipelineService.write_pipeline(entity)

        self.assertEquals(
            PipelineService.fetch_pipeline_by_id(entity.id),
            entity,
        )