Skip to content

Commit

Permalink
Test for indentation in channel.json
Browse files Browse the repository at this point in the history
First indicated by #4378.
  • Loading branch information
FichteFoll committed Apr 29, 2015
1 parent 51dcfd5 commit e130c04
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test.py
Expand Up @@ -205,7 +205,7 @@ def _test_repository_package_order(self, include, data):
self.assertEqual(packages, sorted(packages, key=str_cls.lower),
"Packages must be sorted alphabetically (by name)")

def _test_repository_indents(self, include, contents):
def _test_indentation(self, filename, contents):
for i, line in enumerate(contents.splitlines()):
self.assertRegex(line, r"^\t*\S",
"Indent must be tabs in line %d" % (i + 1))
Expand Down Expand Up @@ -594,6 +594,9 @@ def test_channel_keys(self):
for repo in self.j['repositories']:
self.assertIsInstance(repo, str_cls)

def test_indentation(self):
return self._test_indentation(None, self.source)

def test_channel_repo_order(self):
repos = self.j['repositories']
self.assertEqual(repos, sorted(repos, key=str_cls.lower),
Expand Down Expand Up @@ -653,7 +656,7 @@ def generate_include_tests(cls, stream):
continue

# `include` is for output during tests only
yield cls._test_repository_indents, (include, contents)
yield cls._test_indentation, (include, contents)
yield cls._test_repository_keys, (include, data)
yield cls._test_repository_package_order, (include, data)

Expand Down

0 comments on commit e130c04

Please sign in to comment.