mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Add unit test for file._starts_till function
This commit is contained in:
parent
93e0df03a2
commit
47fbe03c14
@ -859,6 +859,18 @@ class FilemodLineTests(TestCase, LoaderModuleMockMixin):
|
||||
filemod.line('foo', content='test content', mode='insert')
|
||||
assert '"location" or "before/after"' in str(cmd_err)
|
||||
|
||||
def test_util_starts_till(self):
|
||||
'''
|
||||
Test for file._starts_till function.
|
||||
|
||||
:return:
|
||||
'''
|
||||
src = '<here is something>'
|
||||
assert 1 == filemod._starts_till(src=src, probe='<here quite something else>')
|
||||
assert 0 == filemod._starts_till(src=src, probe='<here is something>')
|
||||
assert -1 == filemod._starts_till(src=src, probe='<and here is something>')
|
||||
|
||||
|
||||
|
||||
class FileBasicsTestCase(TestCase, LoaderModuleMockMixin):
|
||||
def setup_loader_modules(self):
|
||||
|
Loading…
Reference in New Issue
Block a user