Exemplo n.º 1
0
 def test_validation(self, does_not_exist, does_exist):
     gtf = gapic_generation.GapicTaskFactory()
     gcpb = code_generation.CodeGenerationPipelineBase(gtf,
         language='python',
         publish='noop',
     )
     does_exist.assert_called_once()
     does_not_exist.assert_called_once()
Exemplo n.º 2
0
    def test_constructor(self, super_init):
        cgpb = code_generation.CodeGenerationPipelineBase(None)

        # Assert that the superclass constructor was called.
        super_init.assert_called_once()

        # Assert that the expected keyword arguments were sent.
        _, _, kwargs = super_init.mock_calls[0]
        assert len(kwargs) == 0
Exemplo n.º 3
0
    def test_constructor_not_remote_mode(self, super_init):
        cgpb = code_generation.CodeGenerationPipelineBase(None,
            remote_mode=False,
        )

        # Assert that the superclass constructor was called.
        super_init.assert_called_once()

        # Assert that the expected keyword arguments were sent.
        _, _, kwargs = super_init.mock_calls[0]
        assert len(kwargs) == 1
        assert kwargs['remote_mode'] is False
Exemplo n.º 4
0
    def test_constructor(self, uuid4, super_init):
        uuid4.return_value = '00000000'
        cgpb = code_generation.CodeGenerationPipelineBase(None,
            remote_mode=True,
        )

        # Assert that the superclass constructor was called.
        super_init.assert_called_once()

        # Assert that the expected keyword arguments were sent.
        _, _, kwargs = super_init.mock_calls[0]
        assert len(kwargs) == 5
        assert kwargs['tarfile'] == '00000000.tar.gz'
        assert kwargs['bucket_name'] == 'pipeline'
        assert kwargs['src_path'] == '00000000.tar.gz'
        assert kwargs['dest_path'].endswith('00000000.tar.gz')
        assert kwargs['remote_mode'] is True