1# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
2# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
3#
4# MDAnalysis --- https://www.mdanalysis.org
5# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
6# (see the file AUTHORS for the full list of names)
7#
8# Released under the GNU Public Licence, v2 or any higher version
9#
10# Please cite your use of MDAnalysis in published work:
11#
12# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler,
13# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein.
14# MDAnalysis: A Python package for the rapid analysis of molecular dynamics
15# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th
16# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy.
17#
18# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein.
19# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations.
20# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787
21#
22from __future__ import absolute_import
23
24import MDAnalysis as mda
25import pytest
26
27from MDAnalysisTests.topology.base import ParserBase
28from MDAnalysisTests.datafiles import (
29    XYZ,
30    XYZ_bz2,
31    XYZ_mini,
32)
33
34
35class XYZBase(ParserBase):
36    parser = mda.topology.XYZParser.XYZParser
37    expected_n_residues = 1
38    expected_n_segments = 1
39    expected_attrs = ['names']
40    guessed_attrs = ['types', 'masses']
41
42
43class TestXYZMini(XYZBase):
44    ref_filename = XYZ_mini
45    expected_n_atoms = 3
46
47
48class TestXYZParser(XYZBase):
49    expected_n_atoms = 1284
50
51    @pytest.fixture(params=[XYZ, XYZ_bz2])
52    def filename(self, request):
53        return request.param
54