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_delete_invalid(self):
self._deploy()
self.assertRaises(ValueError, commands.delete)
self.assertRaises(ValueError, commands.delete, ['3.0'])
self.assertRaises(ValueError, commands.delete, ['1.0'],
branch='branch')
def test_branch(self):
self._deploy('branch')
commands.delete(['1.0'], branch='branch')
check_call_silent(['git', 'checkout', 'branch'])
self._test_delete()
def test_delete_version(self):
self._deploy()
commands.delete(['1.0'])
check_call_silent(['git', 'checkout', 'gh-pages'])
self._test_delete()
def xtest_delete_all(self):
self._deploy()
commands.delete(all=True)
check_call_silent(['git', 'checkout', 'gh-pages'])
message = subprocess.check_output(['git', 'log', '-1', '--pretty=%B'],
universal_newlines=True).rstrip()
self.assertRegex(message, r'^Removed everything with mike \S+$')
assertDirectory('.', set())
def test_delete_all(self):
self._deploy()
commands.delete(all=True)
check_call_silent(['git', 'checkout', 'gh-pages'])
message = subprocess.check_output(['git', 'log', '-1', '--pretty=%B'],
universal_newlines=True).rstrip()
self.assertRegex(message, r'^Removed everything with mike \S+$')
assertDirectory('.', set())
def test_delete_alias(self):
self._deploy()
commands.delete(['stable'])
check_call_silent(['git', 'checkout', 'gh-pages'])
self._test_delete(expected_versions=[
versions.VersionInfo('2.0'),
versions.VersionInfo('1.0'),
])
def test_commit_message(self):
self._deploy()
commands.delete(['1.0'], message='commit message')
check_call_silent(['git', 'checkout', 'gh-pages'])
self._test_delete('^commit message$')
def delete(args):
check_remote_status(args, strict=True)
commands.delete(args.version, args.all, args.branch, args.message)
if args.push:
git_utils.push_branch(args.remote, args.branch, args.force)