Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing: Things an IMDReader can't do #5

Open
ljwoods2 opened this issue Aug 31, 2024 · 1 comment
Open

Testing: Things an IMDReader can't do #5

ljwoods2 opened this issue Aug 31, 2024 · 1 comment

Comments

@ljwoods2
Copy link
Collaborator

For all skipped tests in imdclient/tests/test_imdreader.py::TestIMDReaderBaseAPI, there should be a corresponding test which ensures an error is raised if the associated reader API call is made. These should be either individual methods or a part of a separate test class (not inside of TestIMDReaderBaseAPI)

For example, this method is skipped in TestIMDReaderBaseAPI. Since a rewind can't be done on a stream, there should be another method ("test_rewind_raises_<some_error>" or similar) that ensures the reader will fail out with an appropriate message if the user attempts to call trajectory.rewind().

    @pytest.mark.skip(reason="Cannot rewind stream")
    def test_transformation_rewind(self, ref, transformed):
        # this test checks if the transformations are applied after rewinding the
        # trajectory
        v1 = np.float32((1, 1, 1))
        v2 = np.float32((0, 0, 0.33))
        ideal_coords = ref.iter_ts(0).positions + v1 + v2
        transformed.rewind()
        assert_array_almost_equal(
            transformed[0].positions, ideal_coords, decimal=ref.prec
        )
@ljwoods2
Copy link
Collaborator Author

ljwoods2 commented Oct 2, 2024

@ljwoods2 ljwoods2 mentioned this issue Oct 8, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant