From f9fb6c6d9ba083aabc11618acad9304d12aea354 Mon Sep 17 00:00:00 2001 From: Claas Date: Sun, 10 Nov 2024 19:39:27 +0100 Subject: [PATCH] renamed class `CppFormatter` to `NativeFormatter` and class `CppParser` to `NativeParser` --- ruff.toml | 11 ++++----- src/dictIO/__init__.py | 4 ++-- src/dictIO/dict.py | 8 +++---- src/dictIO/dictWriter.py | 4 ++-- src/dictIO/formatter.py | 14 ++++++------ src/dictIO/parser.py | 20 ++++++++--------- tests/test_cppdict.py | 4 ++-- tests/test_dict.py | 4 ++-- tests/test_dictReader.py | 4 ++-- tests/test_formatter.py | 24 ++++++++++---------- tests/test_parser.py | 48 ++++++++++++++++++++-------------------- 11 files changed, 73 insertions(+), 72 deletions(-) diff --git a/ruff.toml b/ruff.toml index bb54b1e2..8ba2dd0f 100644 --- a/ruff.toml +++ b/ruff.toml @@ -21,15 +21,16 @@ select = [ ] ignore = [ # Ruff lint rules temporarily ignored, but which should be reactivated and resolved in the future. - "D100", # Missing docstring in public module <- @TODO: reactivate and resolve docstring issues @CLAROS, 2024-10-21 - "D104", # Missing docstring in public package <- @TODO: reactivate and resolve docstring issues @CLAROS, 2024-10-21 - "D105", # Missing docstring in magic method <- @TODO: reactivate and resolve docstring issues @CLAROS, 2024-10-21 - "D107", # Missing docstring in __init__ <- @TODO: reactivate and resolve docstring issues @CLAROS, 2024-10-21 - "N999", # Invalid module name <- @TODO: reactivate and resolve @CLAROS, 2024-10-11 + "D100", # Missing docstring in public module <- @TODO: reactivate and resolve docstring issues @CLAROS, 2024-10-21 + "D104", # Missing docstring in public package <- @TODO: reactivate and resolve docstring issues @CLAROS, 2024-10-21 + "D105", # Missing docstring in magic method <- @TODO: reactivate and resolve docstring issues @CLAROS, 2024-10-21 + "D107", # Missing docstring in __init__ <- @TODO: reactivate and resolve docstring issues @CLAROS, 2024-10-21 + # "N999", # Invalid module name <- @TODO: reactivate and resolve @CLAROS, 2024-10-11 "C901", # Function is too complex <- @TODO: reactivate and resolve print statements @CLAROS, 2024-09-22 "PLR0911", # Too many return statements <- @TODO: reactivate and resolve @CLAROS, 2024-10-11 "PLR0912", # Too many branches <- @TODO: reactivate and resolve @CLAROS, 2024-10-11 "PLR0915", # Too many statements <- @TODO: reactivate and resolve @CLAROS, 2024-10-11 + # Ruff lint rules considered as too strict and hence ignored "ANN101", # Missing type annotation for `self` argument in instance methods (NOTE: also listed as deprecated by Ruff) "ANN102", # Missing type annotation for `cls` argument in class methods (NOTE: also listed as deprecated by Ruff) diff --git a/src/dictIO/__init__.py b/src/dictIO/__init__.py index 06188331..8458ca1a 100644 --- a/src/dictIO/__init__.py +++ b/src/dictIO/__init__.py @@ -12,14 +12,14 @@ from dictIO.formatter import ( Formatter, - CppFormatter, + NativeFormatter, FoamFormatter, JsonFormatter, XmlFormatter, ) from dictIO.parser import ( Parser, - CppParser, + NativeParser, FoamParser, JsonParser, XmlParser, diff --git a/src/dictIO/dict.py b/src/dictIO/dict.py index 4997fa2c..f83d54b4 100644 --- a/src/dictIO/dict.py +++ b/src/dictIO/dict.py @@ -597,9 +597,9 @@ def include(self, dict_to_include: SDict[_K, _V]) -> None: f"Cannot include {dict_to_include.name}. Relative path to {dict_to_include.name} could not be resolved." ) from e - from dictIO import CppFormatter + from dictIO import NativeFormatter - formatter = CppFormatter() + formatter = NativeFormatter() include_file_name = str(relative_file_path) include_file_name = include_file_name.replace("\\", "\\\\") include_file_name = formatter.format_value(include_file_name) @@ -786,10 +786,10 @@ def __str__(self) -> str: the string representation """ from dictIO import ( - CppFormatter, # __str__ shall be formatted in dictIO native file format + NativeFormatter, # __str__ shall be formatted in dictIO native file format ) - formatter = CppFormatter() + formatter = NativeFormatter() return formatter.to_string(cast(SDict[TKey, TValue], self)) def __repr__(self) -> str: diff --git a/src/dictIO/dictWriter.py b/src/dictIO/dictWriter.py index 706db5a8..3a7286ea 100644 --- a/src/dictIO/dictWriter.py +++ b/src/dictIO/dictWriter.py @@ -4,7 +4,7 @@ from collections.abc import MutableMapping, MutableSequence from pathlib import Path -from dictIO import CppParser, Formatter, SDict, order_keys +from dictIO import Formatter, NativeParser, SDict, order_keys from dictIO.types import TKey, TValue __ALL__ = ["DictWriter", "create_target_file_name"] @@ -78,7 +78,7 @@ def write( formatter = formatter or Formatter.get_formatter(target_file) # Before writing the dict, doublecheck once again that all of its elements are correctly typed. - parser = CppParser() + parser = NativeParser() parser.parse_values(source_dict) # If mode is set to 'a' (append) and target_file exists: diff --git a/src/dictIO/formatter.py b/src/dictIO/formatter.py index 9936af94..09a8e971 100644 --- a/src/dictIO/formatter.py +++ b/src/dictIO/formatter.py @@ -22,7 +22,7 @@ __ALL__ = [ "Formatter", - "CppFormatter", + "NativeFormatter", "FoamFormatter", "JsonFormatter", "XmlFormatter", @@ -71,8 +71,8 @@ def get_formatter(cls, target_file: Path | None = None) -> Formatter: ]: # .xml or OSP .ssd -> XmlFormatter return XmlFormatter() - # 2. If no target file is passed, return CppFormatter as default / fallback - return CppFormatter() # default + # 2. If no target file is passed, return NativeFormatter as default / fallback + return NativeFormatter() # default @abstractmethod def to_string( @@ -447,11 +447,11 @@ def add_double_quotes(self, arg: str) -> str: return f'"{arg}"' -class CppFormatter(Formatter): +class NativeFormatter(Formatter): """Formatter to serialize a dict into a string in dictIO native file format.""" def __init__(self) -> None: - """Define default configuration for CppFormatter.""" + """Define default configuration for NativeFormatter.""" # Invoke base class constructor super().__init__() @@ -850,7 +850,7 @@ def remove_trailing_spaces(self, s: str) -> str: return ns -class FoamFormatter(CppFormatter): +class FoamFormatter(NativeFormatter): """Formatter to serialize a dict into a string in OpenFOAM dictionary format.""" def __init__(self) -> None: @@ -893,7 +893,7 @@ def remove_underscore_keys_recursive( dict_adapted_for_foam = deepcopy(arg) remove_underscore_keys_recursive(dict_adapted_for_foam) - # Call base class implementation (CppFormatter) + # Call base class implementation (NativeFormatter) s = super().to_string(dict_adapted_for_foam) # Substitute all remeining single quotes, if any, by double quotes: diff --git a/src/dictIO/parser.py b/src/dictIO/parser.py index cb760a56..e2dc34a3 100644 --- a/src/dictIO/parser.py +++ b/src/dictIO/parser.py @@ -21,7 +21,7 @@ if TYPE_CHECKING: import os -__ALL__ = ["Parser", "CppParser", "FoamParser", "JsonParser", "XmlParser"] +__ALL__ = ["Parser", "NativeParser", "FoamParser", "JsonParser", "XmlParser"] logger = logging.getLogger(__name__) @@ -66,8 +66,8 @@ def get_parser(cls, source_file: Path | None = None) -> Parser: ]: # .xml or OSP .ssd -> XmlParser return XmlParser() - # 2. If no source file is passed, return CppParser as default / fallback - return CppParser() # default + # 2. If no source file is passed, return NativeParser as default / fallback + return NativeParser() # default def parse_file( self, @@ -382,11 +382,11 @@ def remove_quotes_from_strings( return arg -class CppParser(Parser): +class NativeParser(Parser): """Parser to deserialize a string in dictIO native file format into a SDict.""" def __init__(self) -> None: - """Define default configuration for CppParser.""" + """Define default configuration for NativeParser.""" # Invoke base class constructor super().__init__() @@ -1082,12 +1082,12 @@ def _parse_tokenized_dict( + "/" ) logger.warning( - f"CppParser._parse_tokenized_dict(): tokens skipped: {key_value_pair_tokens} inside {context}" + f"NativeParser._parse_tokenized_dict(): tokens skipped: {key_value_pair_tokens} inside {context}" ) else: if len(key_value_pair_tokens) > 3: # noqa: PLR2004 logger.warning( - "CppParser._parse_tokenized_dict(): " + "NativeParser._parse_tokenized_dict(): " f"more tokens in key-value pair than expected: {key_value_pair_tokens!s}" ) # read the key (name) (first token, by convention) @@ -1292,9 +1292,9 @@ def _clean( self, s_dict: SDict[TKey, TValue], ) -> None: - """Remove CppFormatter / CppParser specific internal keys from dict. + """Remove NativeFormatter / NativeParser specific internal keys from dict. - Removes keys written by CppFormatter for documentation purposes + Removes keys written by NativeFormatter for documentation purposes but which shall not be created as keys in dict.data. In specific, it is the following two keys that get deleted if existing: _variables @@ -1306,7 +1306,7 @@ def _clean( del s_dict["_includes"] -class FoamParser(CppParser): +class FoamParser(NativeParser): """Parser to deserialize a string in OpenFOAM dictionary format into a SDict.""" def __init__(self) -> None: diff --git a/tests/test_cppdict.py b/tests/test_cppdict.py index 0f564d6e..988ae8ba 100644 --- a/tests/test_cppdict.py +++ b/tests/test_cppdict.py @@ -8,10 +8,10 @@ from dictIO import ( CppDict, - CppParser, DictParser, DictReader, DictWriter, + NativeParser, SDict, find_global_key, order_keys, @@ -22,7 +22,7 @@ @pytest.fixture def test_dict() -> SDict[TKey, TValue]: - parser = CppParser() + parser = NativeParser() return parser.parse_file(Path("test_dict_dict")) diff --git a/tests/test_dict.py b/tests/test_dict.py index 0ec2c514..544dd676 100644 --- a/tests/test_dict.py +++ b/tests/test_dict.py @@ -9,10 +9,10 @@ from dictIO import ( CppDict, - CppParser, DictParser, DictReader, DictWriter, + NativeParser, SDict, find_global_key, order_keys, @@ -23,7 +23,7 @@ @pytest.fixture def test_dict() -> SDict[TKey, TValue]: - parser = CppParser() + parser = NativeParser() return parser.parse_file(Path("test_dict_dict")) diff --git a/tests/test_dictReader.py b/tests/test_dictReader.py index 73a266fa..f4f191b0 100644 --- a/tests/test_dictReader.py +++ b/tests/test_dictReader.py @@ -11,7 +11,7 @@ import pytest from numpy.testing import assert_array_equal -from dictIO import CppParser, DictReader, DictWriter, SDict +from dictIO import DictReader, DictWriter, NativeParser, SDict from dictIO.types import TKey, TValue WindowsOnly: pytest.MarkDecorator = pytest.mark.skipif(not sys.platform.startswith("win"), reason="windows only test") @@ -619,7 +619,7 @@ def prepare_dict_until( ) -> None: file_name = Path.cwd() / file_to_read - parser = CppParser() + parser = NativeParser() _ = parser.parse_file(file_name, dict_to_prepare) funcs = [ diff --git a/tests/test_formatter.py b/tests/test_formatter.py index b0ab4b68..a83c23a7 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -5,7 +5,7 @@ import pytest -from dictIO import CppFormatter, DictReader, FoamFormatter, SDict, XmlFormatter +from dictIO import DictReader, FoamFormatter, NativeFormatter, SDict, XmlFormatter if TYPE_CHECKING: from dictIO.types import TKey, TValue @@ -36,7 +36,7 @@ class TestCppFormatter: ) def test_format_type_string_no_additional_quotes_expected(self, str_in: str) -> None: # Prepare - formatter = CppFormatter() + formatter = NativeFormatter() str_expected = str_in # Execute str_out = formatter.format_value(str_in) @@ -56,7 +56,7 @@ def test_format_type_string_no_additional_quotes_expected(self, str_in: str) -> ) def test_format_type_string_additional_single_quotes_expected(self, str_in: str) -> None: # Prepare - formatter = CppFormatter() + formatter = NativeFormatter() str_expected = f"'{str_in}'" # Execute str_out = formatter.format_value(str_in) @@ -75,7 +75,7 @@ def test_format_type_string_additional_single_quotes_expected(self, str_in: str) ) def test_format_type_string_additional_double_quotes_expected(self, str_in: str) -> None: # Prepare - formatter = CppFormatter() + formatter = NativeFormatter() str_expected = f'"{str_in}"' # Execute str_out = formatter.format_value(str_in) @@ -84,7 +84,7 @@ def test_format_type_string_additional_double_quotes_expected(self, str_in: str) def test_format_type_float(self) -> None: # sourcery skip: extract-duplicate-method, inline-variable - formatter = CppFormatter() + formatter = NativeFormatter() float_in = 1.23 str_out = formatter.format_value(float_in) assert isinstance(str_out, str) @@ -101,7 +101,7 @@ def test_format_type_float(self) -> None: def test_insert_block_comments(self) -> None: # sourcery skip: class-extract-method # Prepare - formatter = CppFormatter() + formatter = NativeFormatter() as_is_block_comment = ( "/*---------------------------------*- C++ -*----------------------------------*\\\n" "This is a block comment; coding utf-8; version 0.1;\n" @@ -122,7 +122,7 @@ def test_insert_block_comments(self) -> None: @staticmethod def run_block_comment_tests( - formatter: CppFormatter, + formatter: NativeFormatter, as_is_block_comment: str, default_block_comment: str, ) -> None: @@ -220,7 +220,7 @@ def test_insert_includes(self) -> None: include_placeholder = "INCLUDE000102 INCLUDE000102;" str_in = blockcomment_placeholder + "\n" + include_placeholder + "\n" str_expected = str_in.replace(include_placeholder, include_directive_in.replace('"', "'")) - formatter = CppFormatter() + formatter = NativeFormatter() # Execute str_out = formatter.insert_includes(s_dict, str_in) # Assert @@ -230,7 +230,7 @@ def test_insert_line_comments(self) -> None: # Prepare s_dict: SDict[TKey, TValue] = SDict() line_comment_in = "// This is a line comment" - formatter = CppFormatter() + formatter = NativeFormatter() str_in_template = formatter.format_dict(s_dict) s_dict.line_comments = {103: line_comment_in} placeholder1 = "BLOCKCOMMENT000101 BLOCKCOMMENT000101;" @@ -280,7 +280,7 @@ def test_remove_trailing_spaces(self) -> None: multi_line_str_expected += str_expected_6 + "\n" multi_line_str_expected += str_expected_7 - formatter = CppFormatter() + formatter = NativeFormatter() # Execute 1 multi_line_str_out = formatter.remove_trailing_spaces(multi_line_str_in) @@ -324,7 +324,7 @@ def test_list_with_nested_list(self) -> None: s_dict: SDict[TKey, TValue] = SDict() dict_in = deepcopy(s_dict) dict_in.update(test_obj) - formatter = CppFormatter() + formatter = NativeFormatter() assert test_obj == dict_in # Execute str_in: str = formatter.format_dict(test_obj) @@ -335,7 +335,7 @@ def test_list_with_nested_list(self) -> None: def test_to_string_does_not_alter_original(self) -> None: # Prepare dict_in = DictReader.read(Path("test_formatter_dict")) - formatter = CppFormatter() + formatter = NativeFormatter() dict_in_reference = dict_in dict_in_shallowcopy = copy(dict_in) # Execute diff --git a/tests/test_parser.py b/tests/test_parser.py index 91c1738d..be97056f 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -8,7 +8,7 @@ import pytest -from dictIO import CppParser, Parser, SDict, XmlParser +from dictIO import NativeParser, Parser, SDict, XmlParser from dictIO.types import TKey, TValue from dictIO.utils.counter import BorgCounter from dictIO.utils.strings import string_diff @@ -348,7 +348,7 @@ def test_extract_line_comments(self) -> None: # sourcery skip: no-loop-in-tests # Prepare s_dict: SDict[TKey, TValue] = SDict() - parser = CppParser() + parser = NativeParser() line1 = "a line with no line comment\n" line2 = "//a line comment\n" line3 = "a line with //an inline comment\n" @@ -369,7 +369,7 @@ def test_extract_includes(self) -> None: # sourcery skip: no-loop-in-tests # Prepare s_dict: SDict[TKey, TValue] = SDict() - parser = CppParser() + parser = NativeParser() line1 = "a line with no include directive\n" line2 = "#include testDict\n" line3 = "#include 'testDict'\n" @@ -402,7 +402,7 @@ def test_extract_includes(self) -> None: def test_convert_line_content_to_block_content(self) -> None: # Prepare s_dict: SDict[TKey, TValue] = SDict() - parser = CppParser() + parser = NativeParser() # Three lines with line endings line1 = "line 1\n" line2 = "line 2\n" @@ -416,7 +416,7 @@ def test_convert_line_content_to_block_content(self) -> None: def test_remove_line_endings_from_block_content(self) -> None: # Prepare s_dict: SDict[TKey, TValue] = SDict() - parser = CppParser() + parser = NativeParser() # Three lines with line endings line1 = "line 1\n" line2 = "line 2\n" @@ -431,7 +431,7 @@ def test_remove_line_endings_from_block_content(self) -> None: def test_extract_block_comments(self) -> None: # Prepare s_dict: SDict[TKey, TValue] = SDict() - parser = CppParser() + parser = NativeParser() text_block_in = ( "This is a text block\n" "with multiple lines. Within this text block, there are C++ block comments.\n" @@ -467,7 +467,7 @@ def test_extract_block_comments(self) -> None: def test_extract_string_literals(self) -> None: # Prepare s_dict: SDict[TKey, TValue] = SDict() - parser = CppParser() + parser = NativeParser() text_block_in = ( "This is a text block\n" "with multiple lines. Within this text block, there are inline substrings with single quotes.\n" @@ -514,7 +514,7 @@ def test_extract_string_literals(self) -> None: def test_extract_expressions(self) -> None: # Prepare s_dict: SDict[TKey, TValue] = SDict() - parser = CppParser() + parser = NativeParser() text_block_in = ( "This is a text block\n" "with multiple lines. Within this text block, there are key value pairs where the value\n" @@ -599,7 +599,7 @@ def test_extract_expressions(self) -> None: def test_extract_single_character_expressions(self) -> None: # Prepare s_dict: SDict[TKey, TValue] = SDict() - parser = CppParser() + parser = NativeParser() text_block_in = ( "This is a text block\n" "with multiple lines. Within this text block, there are key value pairs where the value\n" @@ -685,7 +685,7 @@ def test_separate_delimiters(self) -> None: # sourcery skip: no-loop-in-tests # Prepare s_dict: SDict[TKey, TValue] = SDict() - parser = CppParser() + parser = NativeParser() text_block_in = ( "This is a text block\n" "with multiple lines. Within this text block there are distinct chars that shall be identified as delimiters.\n" @@ -732,7 +732,7 @@ def test_separate_delimiters(self) -> None: def test_determine_token_hierarchy(self) -> None: # Prepare s_dict: SDict[TKey, TValue] = SDict() - parser = CppParser() + parser = NativeParser() text_block = ( "level0 { level1 { level2 { level3 } level2 } level1 } level0\n" "level0 [ level1 [ level2 [ level3 ] level2 ] level1 ] level0\n" @@ -752,7 +752,7 @@ def test_parse_tokenized_dict(self) -> None: # Prepare dict_in: SDict[TKey, TValue] = SDict() SetupHelper.prepare_dict_until(dict_to_prepare=dict_in, until_step=9) - parser = CppParser() + parser = NativeParser() # Execute dict_out = parser._parse_tokenized_dict(dict_in, dict_in.tokens, level=0) # Assert @@ -779,7 +779,7 @@ def test_parse_tokenized_dict_booleans(self) -> None: # Prepare dict_in: SDict[TKey, TValue] = SDict() SetupHelper.prepare_dict_until(dict_to_prepare=dict_in, until_step=9) - parser = CppParser() + parser = NativeParser() # Execute dict_out = parser._parse_tokenized_dict(dict_in, dict_in.tokens, level=0) # Assert @@ -805,7 +805,7 @@ def test_parse_tokenized_dict_numbers(self) -> None: # Prepare dict_in: SDict[TKey, TValue] = SDict() SetupHelper.prepare_dict_until(dict_to_prepare=dict_in, until_step=9) - parser = CppParser() + parser = NativeParser() # Execute dict_out = parser._parse_tokenized_dict(dict_in, dict_in.tokens, level=0) # Assert @@ -821,7 +821,7 @@ def test_parse_tokenized_dict_nones(self) -> None: # Prepare dict_in: SDict[TKey, TValue] = SDict() SetupHelper.prepare_dict_until(dict_to_prepare=dict_in, until_step=9) - parser = CppParser() + parser = NativeParser() # Execute dict_out = parser._parse_tokenized_dict(dict_in, dict_in.tokens, level=0) # Assert @@ -835,7 +835,7 @@ def test_parse_tokenized_dict_strings(self) -> None: # Prepare dict_in: SDict[TKey, TValue] = SDict() SetupHelper.prepare_dict_until(dict_to_prepare=dict_in, until_step=9) - parser = CppParser() + parser = NativeParser() # Execute dict_out = parser._parse_tokenized_dict(dict_in, dict_in.tokens, level=0) # Assert @@ -856,16 +856,16 @@ def test_parse_tokenized_dict_invalid(self, caplog: pytest.LogCaptureFixture) -> # Prepare dict_in: SDict[TKey, TValue] = SDict() SetupHelper.prepare_dict_until(dict_to_prepare=dict_in, until_step=9) - parser = CppParser() + parser = NativeParser() log_level_expected = "WARNING" log_message_0_expected = ( - "CppParser._parse_tokenized_dict(): tokens skipped: " + "NativeParser._parse_tokenized_dict(): tokens skipped: " "[(1, 'this'), (1, 'is'), (1, 'not'), (1, 'a'), (1, 'valid'), (1, 'key'), (1, 'value'), (1, 'pair')," " (1, 'because'), (1, 'the'), (1, 'number'), (1, 'of'), (1, 'tokens'), (1, 'is'), (1, 'larger'), (1, 'than'), (1, 'two'), (1, ';')] " "inside /this is not a valid key value pair because the number of tokens is larger than two ; thisIsNeitherAValidKeyValuePairBecuaseThisIsOnlyOneToken ;/" ) log_message_1_expected = ( - "CppParser._parse_tokenized_dict(): tokens skipped: " + "NativeParser._parse_tokenized_dict(): tokens skipped: " "[(1, 'thisIsNeitherAValidKeyValuePairBecuaseThisIsOnlyOneToken'), (1, ';')] " "inside /this is not a valid key value pair because the number of tokens is larger than two ; thisIsNeitherAValidKeyValuePairBecuaseThisIsOnlyOneToken ;/" ) @@ -882,7 +882,7 @@ def test_parse_tokenized_dict_nesting(self) -> None: # Prepare dict_in: SDict[TKey, TValue] = SDict() SetupHelper.prepare_dict_until(dict_to_prepare=dict_in, until_step=9) - parser = CppParser() + parser = NativeParser() # Execute dict_out = parser._parse_tokenized_dict(dict_in, dict_in.tokens, level=0) # Assert @@ -947,7 +947,7 @@ def test_parse_tokenized_dict_expressions(self) -> None: # Prepare dict_in: SDict[TKey, TValue] = SDict() SetupHelper.prepare_dict_until(dict_to_prepare=dict_in, until_step=9) - parser = CppParser() + parser = NativeParser() # Execute dict_out = parser._parse_tokenized_dict(dict_in, dict_in.tokens, level=0) # Assert @@ -980,7 +980,7 @@ def test_parse_tokenized_dict_theDictInAListPitfall(self) -> None: # Prepare dict_in: SDict[TKey, TValue] = SDict() SetupHelper.prepare_dict_until(dict_to_prepare=dict_in, until_step=9, comments=False) - parser = CppParser() + parser = NativeParser() # Execute dict_out = parser._parse_tokenized_dict(dict_in, dict_in.tokens, level=0) # Assert @@ -1016,7 +1016,7 @@ def test_insert_string_literals(self) -> None: # Prepare s_dict: SDict[TKey, TValue] = SDict() SetupHelper.prepare_dict_until(dict_to_prepare=s_dict, until_step=10) - parser = CppParser() + parser = NativeParser() # Execute parser._insert_string_literals(s_dict) # Assert @@ -1165,7 +1165,7 @@ def prepare_dict_until( file_content = f.read() dict_to_prepare.line_content = file_content.splitlines(keepends=True) - parser = CppParser() + parser = NativeParser() funcs = [ partial(