-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: issue with indent function (#257)
io.StringIO wrapper around lines is needed to handle cases when lines is equal to None.
- Loading branch information
Artem Rys
authored
Jul 7, 2021
1 parent
fdf2894
commit 898fdb4
Showing
4 changed files
with
61 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# | ||
# Copyright 2021 Splunk Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
import unittest | ||
|
||
from parameterized import parameterized | ||
from splunk_add_on_ucc_framework.uccrestbuilder.endpoint import base | ||
|
||
|
||
class IndentTest(unittest.TestCase): | ||
@parameterized.expand( | ||
[ | ||
(None, " None"), | ||
( | ||
"\nmax_len=4096,\nmin_len=0,\n", | ||
"\n max_len=4096,\n min_len=0,\n", | ||
), | ||
( | ||
"validator.String(\n max_len=4096,\n min_len=0,\n)", | ||
" validator.String(\n max_len=4096,\n min_len=0,\n )", | ||
), | ||
] | ||
) | ||
def test_indent(self, lines, expected): | ||
self.assertEqual(base.indent(lines), expected) |