Skip to content

Commit 36f34cd

Browse files
alperozturk96backportbot[bot]
authored andcommitted
fix codacy
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 7656a2f commit 36f34cd

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

β€Žapp/src/androidTest/java/com/nextcloud/utils/WebDavParentPathTests.ktβ€Ž

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ import com.nextcloud.utils.extensions.webDavParentPath
1111
import org.junit.Assert.assertEquals
1212
import org.junit.Test
1313

14+
@Suppress("TooManyFunctions")
1415
class WebDavParentPathTests {
1516

16-
// ── Happy path ────────────────────────────────────────────────────────────
17-
1817
@Test
1918
fun testWebDavParentPathWhenGivenCorrectParentShouldReturnOneLevelAbove() {
2019
assertEquals("/Photos/Vacation/", "/Photos/Vacation/beach.jpg".webDavParentPath())
@@ -26,8 +25,6 @@ class WebDavParentPathTests {
2625
assertEquals("/a/b/c/d/", "/a/b/c/d/e.txt".webDavParentPath())
2726
}
2827

29-
// ── Root cases ────────────────────────────────────────────────────────────
30-
3128
@Test
3229
fun testWebDavParentPathWhenGivenRootFileShouldReturnRoot() {
3330
assertEquals("/", "/image.png".webDavParentPath())
@@ -48,8 +45,6 @@ class WebDavParentPathTests {
4845
assertEquals("/", "///".webDavParentPath())
4946
}
5047

51-
// ── Relative paths ────────────────────────────────────────────────────────
52-
5348
@Test
5449
fun testWebDavParentPathWhenGivenRelativePathShouldReturnOneLevelAbove() {
5550
assertEquals("Documents/", "Documents/file.pdf".webDavParentPath())
@@ -60,8 +55,6 @@ class WebDavParentPathTests {
6055
assertEquals("/", "readme.md".webDavParentPath())
6156
}
6257

63-
// ── Trailing slashes ──────────────────────────────────────────────────────
64-
6558
@Test
6659
fun testWebDavParentPathWhenGivenTrailingSlashShouldReturnOneLevelAbove() {
6760
assertEquals("/Photos/", "/Photos/Vacation/".webDavParentPath())
@@ -72,8 +65,6 @@ class WebDavParentPathTests {
7265
assertEquals("/Photos/", "/Photos/Vacation///".webDavParentPath())
7366
}
7467

75-
// ── Encoded characters (WebDAV percent-encoding must be preserved) ────────
76-
7768
@Test
7869
fun testWebDavParentPathWhenGivenEncodedSpacesShouldPreserveEncoding() {
7970
assertEquals("/My%20Photos/", "/My%20Photos/beach%20photo.jpg".webDavParentPath())
@@ -84,15 +75,11 @@ class WebDavParentPathTests {
8475
assertEquals("/files/%23reports/", "/files/%23reports/q1%262.pdf".webDavParentPath())
8576
}
8677

87-
// ── Unicode ───────────────────────────────────────────────────────────────
88-
8978
@Test
9079
fun testWebDavParentPathWhenGivenUnicodeCharsShouldReturnOneLevelAbove() {
9180
assertEquals("/照片/ε‡ζœŸ/", "/照片/ε‡ζœŸ/ζ΅·ζ»©.jpg".webDavParentPath())
9281
}
9382

94-
// ── Single character ──────────────────────────────────────────────────────
95-
9683
@Test
9784
fun testWebDavParentPathWhenGivenSingleCharFileAtRootShouldReturnRoot() {
9885
assertEquals("/", "/a".webDavParentPath())

0 commit comments

Comments
Β (0)