summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/tools/lint/tests/test_path_lints.py
blob: 83cb8aaa6341ec9cb6af1213e87b542b13877fbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from __future__ import unicode_literals

from ..lint import check_path
import pytest
import six

def test_allowed_path_length():
    basename = 29 * "test/"

    for idx in range(5):
        filename = basename + idx * "a"

        errors = check_path("/foo/", filename)
        assert errors == []


def test_forbidden_path_length():
    basename = 29 * "test/"

    for idx in range(5, 10):
        filename = basename + idx * "a"
        message = "/%s longer than maximum path length (%s > 150)" % (filename, 146 + idx)

        errors = check_path("/foo/", filename)
        assert errors == [("PATH LENGTH", message, None)]