mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 20:16:53 +00:00
added unversioned files
This commit is contained in:
parent
bc7315b861
commit
71ee80081d
53 changed files with 1178 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
from pre_commit_hooks.loaderon_hooks.odoo_specific_hooks.check_model_name import main
|
||||
from pre_commit_hooks.loaderon_hooks.tests.util.test_helpers import perform_test_on_file_expecting_result
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def clean_sys_argv():
|
||||
sys.argv = []
|
||||
yield
|
||||
|
||||
|
||||
def test_check_model_name_ok():
|
||||
perform_test_on_file_expecting_result('check_model_name_samples/ok.py', main)
|
||||
|
||||
|
||||
def test_check_model_name_multiple_inheritance_ok():
|
||||
perform_test_on_file_expecting_result('check_model_name_samples/multiple_inheritance_ok.py', main)
|
||||
|
||||
|
||||
def test_check_model_name_error():
|
||||
perform_test_on_file_expecting_result('check_model_name_samples/error.py', main, expected_result=2)
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
from pre_commit_hooks.loaderon_hooks.odoo_specific_hooks.check_view_fields_order import main
|
||||
from pre_commit_hooks.loaderon_hooks.tests.util.test_helpers import perform_test_on_file_expecting_result
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def clean_sys_argv():
|
||||
sys.argv = []
|
||||
yield
|
||||
|
||||
|
||||
def test_check_view_fields_order_ok():
|
||||
perform_test_on_file_expecting_result('check_view_fields_order_samples/ok.xml', main)
|
||||
|
||||
|
||||
def test_check_view_fields_order_multiple_records_ok():
|
||||
perform_test_on_file_expecting_result('check_view_fields_order_samples/multiple_records_ok.xml', main)
|
||||
|
||||
|
||||
def test_check_view_fields_order_name_error():
|
||||
perform_test_on_file_expecting_result('check_view_fields_order_samples/first_field_not_name_error.xml', main, expected_result=2)
|
||||
|
||||
|
||||
def test_check_view_fields_order_model_error():
|
||||
perform_test_on_file_expecting_result('check_view_fields_order_samples/second_field_not_model_error.xml', main, expected_result=2)
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
from pre_commit_hooks.loaderon_hooks.odoo_specific_hooks.check_view_name import main
|
||||
from pre_commit_hooks.loaderon_hooks.tests.util.test_helpers import perform_test_on_file_expecting_result
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def clean_sys_argv():
|
||||
sys.argv = []
|
||||
yield
|
||||
|
||||
|
||||
def test_check_view_name_ok():
|
||||
perform_test_on_file_expecting_result('check_view_name_samples/ok.xml', main)
|
||||
|
||||
|
||||
def test_check_view_name_inherit_ok():
|
||||
perform_test_on_file_expecting_result('check_view_name_samples/inherit_ok.xml', main)
|
||||
|
||||
|
||||
def test_check_view_name_error():
|
||||
perform_test_on_file_expecting_result('check_view_name_samples/error.xml', main, expected_result=2)
|
||||
Loading…
Add table
Add a link
Reference in a new issue