Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Tests point to abs path instead of relative #4

@JosePizarro3

Description

@JosePizarro3

I think some configuration of the tests is wrong. The test should be testing the parse() function of the class itself, without the need to import nomad.client import parse function. I think this client function works matching the parser, or is it implemented such that any parser plugin will be recognized? Also, how optimized this matching would be w.r.t to simply test the class parse() function?

Furthermore, doing this nomad.client.parse creates the need of pointing to the abs path of the tests/data folder, instead of using the relative path. In other words, right now the test config is:

from nomad.client import parse


def test_parser():
    test_file = os.path.join(os.path.dirname(__file__), 'data', 'test.example-format.txt')
    entry_archive = parse(test_file)

but it should be:

from nomadparserexample import ExampleParser


@pytest.fixture(scope='module')
def parser():
    return ExampleParser()


def test_band(parser):
    archive = EntryArchive()
    parser.parse('tests/data/test.example-format.txt', archive, None)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions