feat: check for HTTP 303 also when repository is successfully created
ci/woodpecker/push/woodpecker Pipeline failed Details

closes: #74
fix-74
Hostea dashboard 2023-01-14 13:02:17 +05:30
parent eaff09efd4
commit 87cbc79837
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
2 changed files with 5 additions and 3 deletions

View File

@ -198,7 +198,6 @@ class CreateInstance(TestCase):
register_util(t=self, username="createinstance_user")
create_configurations(t=self)
def test_sanitize_vm_name(self):
self.assertEqual(sanitize_vm_name(vm_name="LOWERname"), "lowername")
@ -208,7 +207,6 @@ class CreateInstance(TestCase):
with self.assertRaises(VmException):
sanitize_vm_name(vm_name="122342$#34234")
@override_settings(
HOSTEA=infra_custom_config(test_name="test_create_instance_util")
)

View File

@ -196,7 +196,11 @@ class Forgejo:
resp = self.c.post(url, data=data, allow_redirects=False)
print(f"Created repository {name}")
if resp.status_code != 302 and resp.status_code != 200:
if (
resp.status_code != 302
and resp.status_code != 200
and resp.status_code != 303
):
raise Exception(
f"Error while creating repository: {name} {resp.status_code}"
)