Esempio n. 1
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,
        )
Esempio n. 2
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,
        )
Esempio n. 3
0
    def test_fetch_pipeline_by_id(self, mock_fetch):
        """Test that you can fetch a PipelineEntity by ID."""
        mock_fetch.return_value = self.pipeline

        entity = PipelineService.fetch_pipeline_by_id(self.pipeline.id)

        self.assertEquals(
            entity.id,
            self.pipeline.id,
        )
Esempio n. 4
0
    def test_fetch_pipeline_by_id(self, mock_fetch):
        """Test that you can fetch a PipelineEntity by ID."""
        mock_fetch.return_value = self.pipeline

        entity = PipelineService.fetch_pipeline_by_id(self.pipeline.id)

        self.assertEquals(
            entity.id,
            self.pipeline.id,
        )