testing/buildbot/scripts/upload_test_result_artifacts_unittest.py
def testUploadArtifactsNoUpload(
      self, copy_patch, rmtree_patch, mkd_patch, digest_patch):
    """Simple test; no artifacts, so data shouldn't change."""
    mkd_patch.return_value = 'foo_dir'
    data = {
        'artifact_type_info': {
            'log': 'text/plain'
        },
        'tests': {
          'foo': {
            'actual': 'PASS',
            'expected': 'PASS',
          }
        }
    }
    self.assertEqual(upload_test_result_artifacts.upload_artifacts(
        data, '/tmp', True, 'test-bucket'), data)
    mkd_patch.assert_called_once_with(prefix='upload_test_artifacts')
    digest_patch.assert_not_called()
    copy_patch.assert_not_called()
    rmtree_patch.assert_called_once_with('foo_dir')
Simple test; no artifacts, so data shouldn't change.
Simple test; no artifacts, so data shouldn't change.
Simple test ; no artifacts so data shouldn ' t change .
def testUploadArtifactsNoUpload(
      self, copy_patch, rmtree_patch, mkd_patch, digest_patch):
    mkd_patch.return_value = 'foo_dir'
    data = {
        'artifact_type_info': {
            'log': 'text/plain'
        },
        'tests': {
          'foo': {
            'actual': 'PASS',
            'expected': 'PASS',
          }
        }
    }
    self.assertEqual(upload_test_result_artifacts.upload_artifacts(
        data, '/tmp', True, 'test-bucket'), data)
    mkd_patch.assert_called_once_with(prefix='upload_test_artifacts')
    digest_patch.assert_not_called()
    copy_patch.assert_not_called()
    rmtree_patch.assert_called_once_with('foo_dir')
def testUploadArtifactsNoUpload ( self , copy_patch , rmtree_patch , mkd_patch , digest_patch ) : mkd_patch . return_value = 'foo_dir' data = { 'artifact_type_info' : { 'log' : 'text/plain' } , 'tests' : { 'foo' : { 'actual' : 'PASS' , 'expected' : 'PASS' , } } } self . assertEqual ( upload_test_result_artifacts . upload_artifacts ( data , '/tmp' , True , 'test-bucket' ) , data ) mkd_patch . assert_called_once_with ( prefix = 'upload_test_artifacts' ) digest_patch . assert_not_called ( ) copy_patch . assert_not_called ( ) rmtree_patch . assert_called_once_with ( 'foo_dir' )
Simple test; no artifacts, so data shouldn't change.
Simple test ; no artifacts so data shouldn ' t change .
"""Simple test; no artifacts, so data shouldn't change."""
self
copy_patch
rmtree_patch
mkd_patch
digest_patch