Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_init():
build_obj = build.Build(_mock_build_event())
assert build_obj.id == BUILD_ID
assert build_obj.project_name == test_constants.PROJECT_NAME
assert build_obj.status == BUILD_STATUS
]
},
{
'events': [
{
'message': 'baz',
},
{
'message': 'blah',
}
]
},
]
_mock_build_details('pr/123')
build_obj = build.Build(_mock_build_event())
build_obj.copy_logs()
mock_codebuild.batch_get_builds.assert_called_once_with(ids=[BUILD_ID])
mock_cw_logs.get_paginator.assert_called_once_with('filter_log_events')
mock_cw_logs.get_paginator.return_value.paginate.assert_called_once_with(
logGroupName=LOG_GROUP_NAME,
logStreamNames=[LOG_STREAM_NAME]
)
mock_bucket.put_object.assert_called_once_with(
Key=LOG_STREAM_NAME + '/build.log',
Body='foobarbazblah',
ContentType="text/plain"
)
def test_get_logs_url(mocker, mock_codebuild):
_mock_build_details('pr/123')
build_obj = build.Build(_mock_build_event())
assert build_obj.get_logs_url() == test_constants.BUILD_LOGS_API_ENDPOINT + '?key=' + LOG_STREAM_NAME + '%2Fbuild.log'
def make_build(fancy=False):
system('rm -rf Jit/*')
print "Building Examples..."
make_examples(fancy)
system('cp -r Examples Jit/')
print "Done. Building Extras..."
system('mkdir Jit/Extras && cp Extras/excanvas.js Jit/Extras/excanvas.js')
print "Done. Building Library..."
lib = Build().build()
license = open('LICENSE', 'r').read()
f = open('Jit/jit.js', 'w')
f.write(license)
f.write(lib)
f.close()
print "Done. Compressing Library..."
f = open('Jit/jit-yc.js', 'w')
f.write(license)
f.close()
system('java -jar Extras/' + YC + ' Jit/jit.js >> Jit/jit-yc.js')
print "Done. Zipping..."
system('rm Jit.zip')
system('zip -r Jit.zip Jit/')
print "Done, I guess."
def complete_build_files():
"""Returns a complete set of build files."""
complete = build.Build()
# Normally we don't need to include @core, but because we look at the build
# object directly, we need to include it here. When using main(), it will
# call addCore which will ensure core is included.
if not complete.parse_build(['+@complete', '+@core'], os.getcwd()):
logging.error('Error parsing complete build')
return False
return complete.include
def main():
return Build().run()
def __build_package(self):
bp = build.Build(self.options)
bp.run()