From 6a24781f96a57082273b3a03479575f8e1c4cb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Wed, 20 Jan 2016 08:15:30 +0100 Subject: [PATCH] Tests: indentation: Add explicit keys test cases --- tests/rules/test_indentation.py | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/rules/test_indentation.py b/tests/rules/test_indentation.py index f497776..fc3ec53 100644 --- a/tests/rules/test_indentation.py +++ b/tests/rules/test_indentation.py @@ -452,3 +452,39 @@ class IndentationTestCase(RuleTestCase): ' 2,\n' ' 3\n' ']\n', conf, problem1=(4, 4), problem2=(5, 2)) + + def test_explicit_block_mappings(self): + conf = 'indentation: {spaces: 4}' + self.check('---\n' + 'object:\n' + ' ? key\n' + ' :\n' + ' value\n' + '...\n', conf) + self.check('---\n' + 'object:\n' + ' ? key\n' + ' :\n' + ' value\n' + '...\n', conf, problem=(5, 8)) + self.check('---\n' + 'object:\n' + ' ?\n' + ' key\n' + ' :\n' + ' value\n' + '...\n', conf) + self.check('---\n' + 'object:\n' + ' ?\n' + ' key\n' + ' :\n' + ' value\n' + '...\n', conf, problem1=(4, 8), problem2=(6, 10)) + self.check('---\n' + 'object:\n' + ' ?\n' + ' key\n' + ' :\n' + ' value\n' + '...\n', conf, problem1=(4, 10), problem2=(6, 8))