# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Cyryl Sochacki <>, 2012. # Paweł Ciecierski , 2012. msgid "" msgstr "" "Project-Id-Version: ownCloud\n" "Report-Msgid-Bugs-To: http://bugs.owncloud.org/\n" "POT-Creation-Date: 2012-08-31 02:02+0200\n" "PO-Revision-Date: 2012-08-30 15:50+0000\n" "Last-Translator: Paweł Ciecierski \n" "Language-Team: Polish (http://www.transifex.com/projects/p/owncloud/language/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pl\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" #: templates/settings.php:8 msgid "Host" msgstr "Host" #: templates/settings.php:8 msgid "" "You can omit the protocol, except you require SSL. Then start with ldaps://" msgstr "Można pominąć protokół, z wyjątkiem wymaganego protokołu SSL. Następnie uruchom z ldaps://" #: templates/settings.php:9 msgid "Base DN" msgstr "Baza DN" #: templates/settings.php:9 msgid "You can specify Base DN for users and groups in the Advanced tab" msgstr "Bazę DN można określić dla użytkowników i grup w karcie Zaawansowane" #: templates/settings.php:10 msgid "User DN" msgstr "Użytkownik DN" #: templates/settings.php:10 msgid "" "The DN of the client user with which the bind shall be done, e.g. " "uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password " "empty." msgstr "DN użytkownika klienta, z którym powiązanie wykonuje się, np. uid=agent,dc=example,dc=com. Dla dostępu anonimowego pozostawić DN i hasło puste" #: templates/settings.php:11 msgid "Password" msgstr "Hasło" #: templates/settings.php:11 msgid "For anonymous access, leave DN and Password empty." msgstr "Dla dostępu anonimowego pozostawić DN i hasło puste." #: templates/settings.php:12 msgid "User Login Filter" msgstr "Filtr logowania użytkownika" #: templates/settings.php:12 #, php-format msgid "" "Defines the filter to apply, when login is attempted. %%uid replaces the " "username in the login action." msgstr "Definiuje filtr do zastosowania, gdy podejmowana jest próba logowania. %%uid zastępuje nazwę użytkownika w działaniu logowania." #: templates/settings.php:12 #, php-format msgid "use %%uid placeholder, e.g. \"uid=%%uid\"" msgstr "Użyj %%uid zastępczy, np. \"uid=%%uid\"" #: templates/settings.php:13 msgid "User List Filter" msgstr "Lista filtrów użytkownika" #: templates/settings.php:13 msgid "Defines the filter to apply, when retrieving users." msgstr "Definiuje filtry do zastosowania, podczas pobierania użytkowników." #: templates/settings.php:13 msgid "without any placeholder, e.g. \"objectClass=person\"." msgstr "bez żadnych symboli zastępczych np. \"objectClass=person\"." #: templates/settings.php:14 msgid "Group Filter" msgstr "Grupa filtrów" #: templates/settings.php:14 msgid "Defines the filter to apply, when retrieving groups." msgstr "Definiuje filtry do zastosowania, podczas pobierania grup." #: templates/settings.php:14 msgid "without any placeholder, e.g. \"objectClass=posixGroup\"." msgstr "bez żadnych symboli zastępczych np. \"objectClass=posixGroup\"." #: templates/settings.php:17 msgid "Port" msgstr "Port" #: templates/settings.php:18 msgid "Base User Tree" msgstr "Drzewo bazy użytkowników" #: templates/settings.php:19 msgid "Base Group Tree" msgstr "Drzewo bazy grup" #: templates/settings.php:20 msgid "Group-Member association" msgstr "Członek grupy stowarzyszenia" #: templates/settings.php:21 msgid "Use TLS" msgstr "Użyj TLS" #: templates/settings.php:21 msgid "Do not use it for SSL connections, it will fail." msgstr "Nie używaj SSL dla połączeń, jeśli się nie powiedzie." #: templates/settings.php:22 msgid "Case insensitve LDAP server (Windows)" msgstr "Wielkość liter serwera LDAP (Windows)" #: templates/settings.php:23 msgid "Turn off SSL certificate validation." msgstr "Wyłączyć sprawdzanie poprawności certyfikatu SSL." #: templates/settings.php:23 msgid "" "If connection only works with this option, import the LDAP server's SSL " "certificate in your ownCloud server." msgstr "Jeśli połączenie działa tylko z tą opcją, zaimportuj certyfikat SSL serwera LDAP w serwerze ownCloud." #: templates/settings.php:23 msgid "Not recommended, use for testing only." msgstr "Niezalecane, użyj tylko testowo." #: templates/settings.php:24 msgid "User Display Name Field" msgstr "Pole wyświetlanej nazwy użytkownika" #: templates/settings.php:24 msgid "The LDAP attribute to use to generate the user`s ownCloud name." msgstr "Atrybut LDAP służy do generowania nazwy użytkownika ownCloud." #: templates/settings.php:25 msgid "Group Display Name Field" msgstr "Pole wyświetlanej nazwy grupy" #: templates/settings.php:25 msgid "The LDAP attribute to use to generate the groups`s ownCloud name." msgstr "Atrybut LDAP służy do generowania nazwy grup ownCloud." #: templates/settings.php:27 msgid "in bytes" msgstr "w bajtach" #: templates/settings.php:29 msgid "in seconds. A change empties the cache." msgstr "w sekundach. Zmiana opróżnia pamięć podręczną." #: templates/settings.php:30 msgid "" "Leave empty for user name (default). Otherwise, specify an LDAP/AD " "attribute." msgstr "Pozostaw puste dla user name (domyślnie). W przeciwnym razie podaj atrybut LDAP/AD." #: templates/settings.php:32 msgid "Help" msgstr "Pomoc" '#n38'>38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
// Copyright 2019 The Gitea Authors. All rights reserved.
// Copyright 2018 Jonas Franz. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package migrations

import (
	"path/filepath"
	"testing"
	"time"

	"code.gitea.io/gitea/models/unittest"
	base "code.gitea.io/gitea/modules/migration"

	"github.com/stretchr/testify/assert"
)

func TestMain(m *testing.M) {
	unittest.MainTest(m, &unittest.TestOptions{
		GiteaRootPath: filepath.Join("..", ".."),
	})
}

func timePtr(t time.Time) *time.Time {
	return &t
}

func assertTimeEqual(t *testing.T, expected, actual time.Time) {
	assert.Equal(t, expected.UTC(), actual.UTC())
}

func assertTimePtrEqual(t *testing.T, expected, actual *time.Time) {
	if expected == nil {
		assert.Nil(t, actual)
	} else {
		assert.NotNil(t, actual)
		assertTimeEqual(t, *expected, *actual)
	}
}

func assertCommentEqual(t *testing.T, expected, actual *base.Comment) {
	assert.Equal(t, expected.IssueIndex, actual.IssueIndex)
	assert.Equal(t, expected.PosterID, actual.PosterID)
	assert.Equal(t, expected.PosterName, actual.PosterName)
	assert.Equal(t, expected.PosterEmail, actual.PosterEmail)
	assertTimeEqual(t, expected.Created, actual.Created)
	assertTimeEqual(t, expected.Updated, actual.Updated)
	assert.Equal(t, expected.Content, actual.Content)
	assertReactionsEqual(t, expected.Reactions, actual.Reactions)
}

func assertCommentsEqual(t *testing.T, expected, actual []*base.Comment) {
	if assert.Len(t, actual, len(expected)) {
		for i := range expected {
			assertCommentEqual(t, expected[i], actual[i])
		}
	}
}

func assertLabelEqual(t *testing.T, expected, actual *base.Label) {
	assert.Equal(t, expected.Name, actual.Name)
	assert.Equal(t, expected.Color, actual.Color)
	assert.Equal(t, expected.Description, actual.Description)
}

func assertLabelsEqual(t *testing.T, expected, actual []*base.Label) {
	if assert.Len(t, actual, len(expected)) {
		for i := range expected {
			assertLabelEqual(t, expected[i], actual[i])
		}
	}
}

func assertMilestoneEqual(t *testing.T, expected, actual *base.Milestone) {
	assert.Equal(t, expected.Title, actual.Title)
	assert.Equal(t, expected.Description, actual.Description)
	assertTimePtrEqual(t, expected.Deadline, actual.Deadline)
	assertTimeEqual(t, expected.Created, actual.Created)
	assertTimePtrEqual(t, expected.Updated, actual.Updated)
	assertTimePtrEqual(t, expected.Closed, actual.Closed)
	assert.Equal(t, expected.State, actual.State)
}

func assertMilestonesEqual(t *testing.T, expected, actual []*base.Milestone) {
	if assert.Len(t, actual, len(expected)) {
		for i := range expected {
			assertMilestoneEqual(t, expected[i], actual[i])
		}
	}
}

func assertIssueEqual(t *testing.T, expected, actual *base.Issue) {
	assert.Equal(t, expected.Number, actual.Number)
	assert.Equal(t, expected.PosterID, actual.PosterID)
	assert.Equal(t, expected.PosterName, actual.PosterName)
	assert.Equal(t, expected.PosterEmail, actual.PosterEmail)
	assert.Equal(t, expected.Title, actual.Title)
	assert.Equal(t, expected.Content, actual.Content)
	assert.Equal(t, expected.Ref, actual.Ref)
	assert.Equal(t, expected.Milestone, actual.Milestone)
	assert.Equal(t, expected.State, actual.State)
	assert.Equal(t, expected.IsLocked, actual.IsLocked)
	assertTimeEqual(t, expected.Created, actual.Created)
	assertTimeEqual(t, expected.Updated, actual.Updated)
	assertTimePtrEqual(t, expected.Closed, actual.Closed)
	assertLabelsEqual(t, expected.Labels, actual.Labels)
	assertReactionsEqual(t, expected.Reactions, actual.Reactions)
	assert.ElementsMatch(t, expected.Assignees, actual.Assignees)
}

func assertIssuesEqual(t *testing.T, expected, actual []*base.Issue) {
	if assert.Len(t, actual, len(expected)) {
		for i := range expected {
			assertIssueEqual(t, expected[i], actual[i])
		}
	}
}

func assertPullRequestEqual(t *testing.T, expected, actual *base.PullRequest) {
	assert.Equal(t, expected.Number, actual.Number)
	assert.Equal(t, expected.Title, actual.Title)
	assert.Equal(t, expected.PosterID, actual.PosterID)
	assert.Equal(t, expected.PosterName, actual.PosterName)
	assert.Equal(t, expected.PosterEmail, actual.PosterEmail)
	assert.Equal(t, expected.Content, actual.Content)
	assert.Equal(t, expected.Milestone, actual.Milestone)
	assert.Equal(t, expected.State, actual.State)
	assertTimeEqual(t, expected.Created, actual.Created)
	assertTimeEqual(t, expected.Updated, actual.Updated)
	assertTimePtrEqual(t, expected.Closed, actual.Closed)
	assertLabelsEqual(t, expected.Labels, actual.Labels)
	assert.Equal(t, expected.PatchURL, actual.PatchURL)
	assert.Equal(t, expected.Merged, actual.Merged)
	assertTimePtrEqual(t, expected.MergedTime, actual.MergedTime)
	assert.Equal(t, expected.MergeCommitSHA, actual.MergeCommitSHA)
	assertPullRequestBranchEqual(t, expected.Head, actual.Head)
	assertPullRequestBranchEqual(t, expected.Base, actual.Base)
	assert.ElementsMatch(t, expected.Assignees, actual.Assignees)
	assert.Equal(t, expected.IsLocked, actual.IsLocked)
	assertReactionsEqual(t, expected.Reactions, actual.Reactions)
}

func assertPullRequestsEqual(t *testing.T, expected, actual []*base.PullRequest) {
	if assert.Len(t, actual, len(expected)) {
		for i := range expected {
			assertPullRequestEqual(t, expected[i], actual[i])
		}
	}
}

func assertPullRequestBranchEqual(t *testing.T, expected, actual base.PullRequestBranch) {
	assert.Equal(t, expected.CloneURL, actual.CloneURL)
	assert.Equal(t, expected.Ref, actual.Ref)
	assert.Equal(t, expected.SHA, actual.SHA)
	assert.Equal(t, expected.RepoName, actual.RepoName)
	assert.Equal(t, expected.OwnerName, actual.OwnerName)
}

func assertReactionEqual(t *testing.T, expected, actual *base.Reaction) {
	assert.Equal(t, expected.UserID, actual.UserID)
	assert.Equal(t, expected.UserName, actual.UserName)
	assert.Equal(t, expected.Content, actual.Content)
}

func assertReactionsEqual(t *testing.T, expected, actual []*base.Reaction) {
	if assert.Len(t, actual, len(expected)) {
		for i := range expected {
			assertReactionEqual(t, expected[i], actual[i])
		}
	}
}

func assertReleaseAssetEqual(t *testing.T, expected, actual *base.ReleaseAsset) {
	assert.Equal(t, expected.ID, actual.ID)
	assert.Equal(t, expected.Name, actual.Name)
	assert.Equal(t, expected.ContentType, actual.ContentType)
	assert.Equal(t, expected.Size, actual.Size)
	assert.Equal(t, expected.DownloadCount, actual.DownloadCount)
	assertTimeEqual(t, expected.Created, actual.Created)
	assertTimeEqual(t, expected.Updated, actual.Updated)
	assert.Equal(t, expected.DownloadURL, actual.DownloadURL)
}

func assertReleaseAssetsEqual(t *testing.T, expected, actual []*base.ReleaseAsset) {
	if assert.Len(t, actual, len(expected)) {
		for i := range expected {
			assertReleaseAssetEqual(t, expected[i], actual[i])
		}
	}
}

func assertReleaseEqual(t *testing.T, expected, actual *base.Release) {
	assert.Equal(t, expected.TagName, actual.TagName)
	assert.Equal(t, expected.TargetCommitish, actual.TargetCommitish)
	assert.Equal(t, expected.Name, actual.Name)
	assert.Equal(t, expected.Body, actual.Body)
	assert.Equal(t, expected.Draft, actual.Draft)
	assert.Equal(t, expected.Prerelease, actual.Prerelease)
	assert.Equal(t, expected.PublisherID, actual.PublisherID)
	assert.Equal(t, expected.PublisherName, actual.PublisherName)
	assert.Equal(t, expected.PublisherEmail, actual.PublisherEmail)
	assertReleaseAssetsEqual(t, expected.Assets, actual.Assets)
	assertTimeEqual(t, expected.Created, actual.Created)
	assertTimeEqual(t, expected.Published, actual.Published)
}

func assertReleasesEqual(t *testing.T, expected, actual []*base.Release) {
	if assert.Len(t, actual, len(expected)) {
		for i := range expected {
			assertReleaseEqual(t, expected[i], actual[i])
		}
	}
}

func assertRepositoryEqual(t *testing.T, expected, actual *base.Repository) {
	assert.Equal(t, expected.Name, actual.Name)
	assert.Equal(t, expected.Owner, actual.Owner)
	assert.Equal(t, expected.IsPrivate, actual.IsPrivate)
	assert.Equal(t, expected.IsMirror, actual.IsMirror)
	assert.Equal(t, expected.Description, actual.Description)
	assert.Equal(t, expected.CloneURL, actual.CloneURL)
	assert.Equal(t, expected.OriginalURL, actual.OriginalURL)
	assert.Equal(t, expected.DefaultBranch, actual.DefaultBranch)
}

func assertReviewEqual(t *testing.T, expected, actual *base.Review) {
	assert.Equal(t, expected.ID, actual.ID, "ID")
	assert.Equal(t, expected.IssueIndex, actual.IssueIndex, "IsssueIndex")
	assert.Equal(t, expected.ReviewerID, actual.ReviewerID, "ReviewerID")
	assert.Equal(t, expected.ReviewerName, actual.ReviewerName, "ReviewerName")
	assert.Equal(t, expected.Official, actual.Official, "Official")
	assert.Equal(t, expected.CommitID, actual.CommitID, "CommitID")
	assert.Equal(t, expected.Content, actual.Content, "Content")
	assert.WithinDuration(t, expected.CreatedAt, actual.CreatedAt, 10*time.Second)
	assert.Equal(t, expected.State, actual.State, "State")
	assertReviewCommentsEqual(t, expected.Comments, actual.Comments)
}

func assertReviewsEqual(t *testing.T, expected, actual []*base.Review) {
	if assert.Len(t, actual, len(expected)) {
		for i := range expected {
			assertReviewEqual(t, expected[i], actual[i])
		}
	}
}

func assertReviewCommentEqual(t *testing.T, expected, actual *base.ReviewComment) {
	assert.Equal(t, expected.ID, actual.ID)
	assert.Equal(t, expected.InReplyTo, actual.InReplyTo)
	assert.Equal(t, expected.Content, actual.Content)
	assert.Equal(t, expected.TreePath, actual.TreePath)
	assert.Equal(t, expected.DiffHunk, actual.DiffHunk)
	assert.Equal(t, expected.Position, actual.Position)
	assert.Equal(t, expected.Line, actual.Line)
	assert.Equal(t, expected.CommitID, actual.CommitID)
	assert.Equal(t, expected.PosterID, actual.PosterID)
	assertReactionsEqual(t, expected.Reactions, actual.Reactions)
	assertTimeEqual(t, expected.CreatedAt, actual.CreatedAt)
	assertTimeEqual(t, expected.UpdatedAt, actual.UpdatedAt)
}

func assertReviewCommentsEqual(t *testing.T, expected, actual []*base.ReviewComment) {
	if assert.Len(t, actual, len(expected)) {
		for i := range expected {
			assertReviewCommentEqual(t, expected[i], actual[i])
		}
	}
}