Esempio n. 1
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/soft_tabs.sls')


def test_indent():
    assert len(errors) == 2


def test_indent_error1():
    assert errors[0][
        'message'] == 'Two space soft tabs not found - 4 space tab found'


def test_indent_error2():
    assert errors[1][
        'message'] == 'Two space soft tabs not found - 5 space tab found'
Esempio n. 2
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/nested_dict.sls')

def test_indent():
  assert len(errors) == 2

def test_indent_error1():
  assert errors[0]['message'] == 'Four space soft tabs for nested dict not found - 2 space tab found'

def test_indent_error2():
  assert errors[1]['message'] == 'Four space soft tabs for nested dict not found - 2 space tab found'
Esempio n. 3
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/valid_state.sls')

def test_valid_state():
  assert len(errors) == 0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/trailing_whitespace.sls')

def test_trailing_whitespace():
  assert len(errors) == 1

def test_trailing_whitespace_error():
  assert errors[0]['message'] == 'Trailing whitespace found'
Esempio n. 5
0
#!/usr/bin/env python

import sys

sys.path.append('.')

import saltlint

errors = saltlint.run('tests/states/invalid_jinja.sls')


def test_invalid_yaml():
    assert len(errors) == 1
Esempio n. 6
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/dataset.sls')

def test_indent():
  assert len(errors) == 0
Esempio n. 7
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/soft_tabs.sls')

def test_indent():
  assert len(errors) == 2

def test_indent_error1():
  assert errors[0]['message'] == 'Two space soft tabs not found - 4 space tab found'

def test_indent_error2():
  assert errors[1]['message'] == 'Two space soft tabs not found - 5 space tab found'
Esempio n. 8
0
#!/usr/bin/env python

import sys

sys.path.append(".")

import saltlint

errors = saltlint.run("tests/states/include.sls")


def test_include():
    assert len(errors) == 0
Esempio n. 9
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/tab_characters.sls')

def test_tabs():
  assert len(errors) == 1

def test_tabs_error():
  assert errors[0]['message'] == 'Tab character(s) found'
Esempio n. 10
0
#!/usr/bin/env python

import sys

sys.path.append('.')

import saltlint

errors = saltlint.run('tests/states/include.sls')


def test_include():
    assert len(errors) == 0
Esempio n. 11
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/tab_characters.sls')


def test_tabs():
    assert len(errors) == 1


def test_tabs_error():
    assert errors[0]['message'] == 'Tab character(s) found'
Esempio n. 12
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/invalid_yaml.sls')


def test_invalid_yaml():
    assert len(errors) == 1
Esempio n. 13
0
#!/usr/bin/env python

import sys

sys.path.append(".")

import saltlint

errors = saltlint.run("tests/states/valid_state.sls")


def test_valid_state():
    assert len(errors) == 0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/trailing_whitespace.sls')


def test_trailing_whitespace():
    assert len(errors) == 1


def test_trailing_whitespace_error():
    assert errors[0]['message'] == 'Trailing whitespace found'
Esempio n. 15
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/invalid_yaml.sls')

def test_invalid_yaml():
  assert len(errors) == 1
Esempio n. 16
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/invalid_jinja.sls')

def test_invalid_yaml():
  assert len(errors) == 1
Esempio n. 17
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/dataset.sls')


def test_indent():
    assert len(errors) == 0
Esempio n. 18
0
#!/usr/bin/env python

import sys
sys.path.append('.')

import saltlint
errors = saltlint.run('tests/states/valid_jinja_state.sls')

def test_valid_state():
  assert len(errors) == 0