openpectus.test.lsp.test_lsp_analysis

Classes

TestLspAnalysisCompletion

A class whose instances are single test cases.

TestLspAnalysisLint

A class whose instances are single test cases.

TestLspAnalysisHover

A class whose instances are single test cases.

TestLspAnalysis

A class whose instances are single test cases.

Functions

create_workspace()

create_document(pcode)

create_position(pcode)

Module Contents

openpectus.test.lsp.test_lsp_analysis.create_workspace()
Return type:

pylsp.workspace.Workspace

openpectus.test.lsp.test_lsp_analysis.create_document(pcode)
Parameters:

pcode (str)

Return type:

pylsp.workspace.Document

openpectus.test.lsp.test_lsp_analysis.create_position(pcode)
Parameters:

pcode (str)

Return type:

openpectus.lsp.model.Position

class openpectus.test.lsp.test_lsp_analysis.TestLspAnalysisCompletion(methodName='runTest')

Bases: unittest.TestCase

A class whose instances are single test cases.

By default, the test code itself should be placed in a method named ‘runTest’.

If the fixture may be used for many test cases, create as many test methods as are needed. When instantiating such a TestCase subclass, specify in the constructor arguments the name of the test method that the instance is to execute.

Test authors should subclass TestCase for their own tests. Construction and deconstruction of the test’s environment (‘fixture’) can be implemented by overriding the ‘setUp’ and ‘tearDown’ methods respectively.

If it is necessary to override the __init__ method, the base class __init__ method must always be called. It is important that subclasses should not change the signature of their __init__ method, since instances of the classes are instantiated automatically by parts of the framework in order to be run.

When subclassing TestCase, you can set these attributes: * failureException: determines which exception will be raised when

the instance’s assertion methods fail; test methods raising this exception will be deemed to have ‘failed’ rather than ‘errored’.

  • longMessage: determines whether long messages (including repr of

    objects used in assert methods) will be printed on failure in addition to any explicit message passed.

  • maxDiff: sets the maximum length of a diff in failure messages

    by assert methods using difflib. It is looked up as an instance attribute so can be configured by individual tests if required.

get_completions(pcode, uod_info=None)
Parameters:
Return type:

list[openpectus.lsp.model.CompletionItem]

get_completion_labels(pcode, uod_info=None)
Parameters:
Return type:

list[str]

test_completions_blank()
test_completions_commands()
test_completions_categorical_additive()
test_completions_categorical_exclusive()
test_completions_categorical_add_option()
test_completions_categorical_add_option_exclusive()
test_completions_simulate_off_tags()
test_completions_tags()
test_completions_watch_tag()
test_completions_watch_operator()
test_completions_watch_rhs()
test_completions_watch_unit()
test_completions_watch_body()
test_completions_watch_body_thr()
test_complete_call_macro_no_macros()
test_complete_call_macro()
class openpectus.test.lsp.test_lsp_analysis.TestLspAnalysisLint(methodName='runTest')

Bases: unittest.TestCase

A class whose instances are single test cases.

By default, the test code itself should be placed in a method named ‘runTest’.

If the fixture may be used for many test cases, create as many test methods as are needed. When instantiating such a TestCase subclass, specify in the constructor arguments the name of the test method that the instance is to execute.

Test authors should subclass TestCase for their own tests. Construction and deconstruction of the test’s environment (‘fixture’) can be implemented by overriding the ‘setUp’ and ‘tearDown’ methods respectively.

If it is necessary to override the __init__ method, the base class __init__ method must always be called. It is important that subclasses should not change the signature of their __init__ method, since instances of the classes are instantiated automatically by parts of the framework in order to be run.

When subclassing TestCase, you can set these attributes: * failureException: determines which exception will be raised when

the instance’s assertion methods fail; test methods raising this exception will be deemed to have ‘failed’ rather than ‘errored’.

  • longMessage: determines whether long messages (including repr of

    objects used in assert methods) will be printed on failure in addition to any explicit message passed.

  • maxDiff: sets the maximum length of a diff in failure messages

    by assert methods using difflib. It is looked up as an instance attribute so can be configured by individual tests if required.

get_diagnostics(pcode, uod_info=None)
Parameters:
Return type:

list[openpectus.lsp.model.Diagnostic]

test_lint()
class openpectus.test.lsp.test_lsp_analysis.TestLspAnalysisHover(methodName='runTest')

Bases: unittest.TestCase

A class whose instances are single test cases.

By default, the test code itself should be placed in a method named ‘runTest’.

If the fixture may be used for many test cases, create as many test methods as are needed. When instantiating such a TestCase subclass, specify in the constructor arguments the name of the test method that the instance is to execute.

Test authors should subclass TestCase for their own tests. Construction and deconstruction of the test’s environment (‘fixture’) can be implemented by overriding the ‘setUp’ and ‘tearDown’ methods respectively.

If it is necessary to override the __init__ method, the base class __init__ method must always be called. It is important that subclasses should not change the signature of their __init__ method, since instances of the classes are instantiated automatically by parts of the framework in order to be run.

When subclassing TestCase, you can set these attributes: * failureException: determines which exception will be raised when

the instance’s assertion methods fail; test methods raising this exception will be deemed to have ‘failed’ rather than ‘errored’.

  • longMessage: determines whether long messages (including repr of

    objects used in assert methods) will be printed on failure in addition to any explicit message passed.

  • maxDiff: sets the maximum length of a diff in failure messages

    by assert methods using difflib. It is looked up as an instance attribute so can be configured by individual tests if required.

pcode = Multiline-String
Show Value
"""
Invalid command
Mark
Mark: Hej
Watch: Run Time
Watch: Run Time >
Watch: Run Time > 3 min
Macro: And
    Mark: a
Call macro: And
Call macro: Bnd
"""
get_hover(pcode, position, uod_info=None)
Parameters:
test_hover_invalid_command()
test_hover_command()
test_hover_command_with_argument()
test_hover_watch_with_tag()
test_hover_watch_with_tag_and_operator()
test_hover_macro()
test_hover_unknown_macro()
class openpectus.test.lsp.test_lsp_analysis.TestLspAnalysis(methodName='runTest')

Bases: unittest.TestCase

A class whose instances are single test cases.

By default, the test code itself should be placed in a method named ‘runTest’.

If the fixture may be used for many test cases, create as many test methods as are needed. When instantiating such a TestCase subclass, specify in the constructor arguments the name of the test method that the instance is to execute.

Test authors should subclass TestCase for their own tests. Construction and deconstruction of the test’s environment (‘fixture’) can be implemented by overriding the ‘setUp’ and ‘tearDown’ methods respectively.

If it is necessary to override the __init__ method, the base class __init__ method must always be called. It is important that subclasses should not change the signature of their __init__ method, since instances of the classes are instantiated automatically by parts of the framework in order to be run.

When subclassing TestCase, you can set these attributes: * failureException: determines which exception will be raised when

the instance’s assertion methods fail; test methods raising this exception will be deemed to have ‘failed’ rather than ‘errored’.

  • longMessage: determines whether long messages (including repr of

    objects used in assert methods) will be printed on failure in addition to any explicit message passed.

  • maxDiff: sets the maximum length of a diff in failure messages

    by assert methods using difflib. It is looked up as an instance attribute so can be configured by individual tests if required.

test_build_commands()