Beispiel #1
0
    def test_minimal(self):
        project = self.create_project()
        version = "bbee5b51f84611e4b14834363b8514c2"

        hook = ReleaseHook(project)
        hook.start_release(version)

        release = Release.objects.get(organization_id=project.organization_id, version=version)
        assert release.organization
        assert ReleaseProject.objects.get(release=release, project=project)
Beispiel #2
0
    def test_update_release(self):
        project = self.create_project()
        version = "bbee5b51f84611e4b14834363b8514c2"
        r = Release.objects.create(organization_id=project.organization_id, version=version)
        r.add_project(project)

        hook = ReleaseHook(project)
        hook.start_release(version)

        release = Release.objects.get(projects=project, version=version)
        assert release.organization == project.organization
Beispiel #3
0
    def test_minimal(self):
        project = self.create_project()
        version = 'bbee5b51f84611e4b14834363b8514c2'

        hook = ReleaseHook(project)
        hook.start_release(version)

        release = Release.objects.get(
            project=project,
            version=version,
        )
        assert release.date_started
Beispiel #4
0
    def test_minimal(self):
        project = self.create_project()
        version = 'bbee5b51f84611e4b14834363b8514c2'

        hook = ReleaseHook(project)
        hook.start_release(version)

        release = Release.objects.get(
            project=project,
            version=version,
        )
        assert release.date_started
Beispiel #5
0
    def test_minimal(self):
        project = self.create_project()
        version = 'bbee5b51f84611e4b14834363b8514c2'

        hook = ReleaseHook(project)
        hook.start_release(version)

        release = Release.objects.get(
            organization_id=project.organization_id,
            version=version,
        )
        assert release.organization
        assert ReleaseProject.objects.get(release=release, project=project)
Beispiel #6
0
    def test_update_release(self):
        project = self.create_project()
        version = 'bbee5b51f84611e4b14834363b8514c2'
        r = Release.objects.create(organization_id=project.organization_id, version=version)
        r.add_project(project)

        hook = ReleaseHook(project)
        hook.start_release(version)

        release = Release.objects.get(
            projects=project,
            version=version,
        )
        assert release.organization == project.organization
Beispiel #7
0
    def test_update_release(self):
        project = self.create_project()
        version = 'bbee5b51f84611e4b14834363b8514c2'
        Release.objects.create(project=project, version=version)

        hook = ReleaseHook(project)
        hook.start_release(version)

        release = Release.objects.get(
            project=project,
            version=version,
        )
        assert release.date_started
        assert release.organization == project.organization
Beispiel #8
0
    def test_bad_version(self):
        project = self.create_project()
        hook = ReleaseHook(project)

        version = ''
        with self.assertRaises(HookValidationError):
            hook.start_release(version)

        with self.assertRaises(HookValidationError):
            hook.finish_release(version)

        with self.assertRaises(HookValidationError):
            hook.set_commits(version, [])

        version = '.'
        with self.assertRaises(HookValidationError):
            hook.start_release(version)

        with self.assertRaises(HookValidationError):
            hook.finish_release(version)

        with self.assertRaises(HookValidationError):
            hook.set_commits(version, [])

        version = '..'
        with self.assertRaises(HookValidationError):
            hook.start_release(version)

        with self.assertRaises(HookValidationError):
            hook.finish_release(version)

        with self.assertRaises(HookValidationError):
            hook.set_commits(version, [])
Beispiel #9
0
    def test_bad_version(self):
        project = self.create_project()
        hook = ReleaseHook(project)

        version = ''
        with self.assertRaises(HookValidationError):
            hook.start_release(version)

        with self.assertRaises(HookValidationError):
            hook.finish_release(version)

        with self.assertRaises(HookValidationError):
            hook.set_commits(version, [])

        version = '.'
        with self.assertRaises(HookValidationError):
            hook.start_release(version)

        with self.assertRaises(HookValidationError):
            hook.finish_release(version)

        with self.assertRaises(HookValidationError):
            hook.set_commits(version, [])

        version = '..'
        with self.assertRaises(HookValidationError):
            hook.start_release(version)

        with self.assertRaises(HookValidationError):
            hook.finish_release(version)

        with self.assertRaises(HookValidationError):
            hook.set_commits(version, [])