Пример #1
0
    def test_create_nothing_when_no_svn_settings_specified(self, repo_stub):
        model = VcsSettingsModel(repo=repo_stub.repo_name)
        model._create_svn_settings(model.repo_settings, {})
        Session().commit()

        branch_ui = model.repo_settings.get_ui_by_section(
            model.SVN_BRANCH_SECTION)
        tag_ui = model.repo_settings.get_ui_by_section(model.SVN_TAG_SECTION)

        assert len(branch_ui) == 0
        assert len(tag_ui) == 0
Пример #2
0
    def test_create(self, repo_stub):
        model = VcsSettingsModel(repo=repo_stub.repo_name)
        model._create_svn_settings(model.repo_settings, SVN_FORM_DATA)
        Session().commit()

        branch_ui = model.repo_settings.get_ui_by_section(
            model.SVN_BRANCH_SECTION)
        tag_ui = model.repo_settings.get_ui_by_section(model.SVN_TAG_SECTION)

        try:
            assert len(branch_ui) == 1
            assert len(tag_ui) == 1
        finally:
            Session().delete(branch_ui[0])
            Session().delete(tag_ui[0])
            Session().commit()