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()
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
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
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