Skip to content

Commit

Permalink
Merge pull request #99 from w3c/test-path-lint
Browse files Browse the repository at this point in the history
Test the path lint; r=gsnedders
  • Loading branch information
gsnedders authored Aug 5, 2016
2 parents 4e591e5 + fff1fab commit f532a68
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lint/tests/test_path_lints.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,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)]

0 comments on commit f532a68

Please sign in to comment.