File: test_saint.py

package info (click to toggle)
finalcif 156%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 53,700 kB
  • sloc: python: 50,427; cpp: 67; sh: 51; makefile: 22
file content (32 lines) | stat: -rw-r--r-- 1,289 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#   ----------------------------------------------------------------------------
#   "THE BEER-WARE LICENSE" (Revision 42):
#   Daniel Kratzert <dkratzert@gmx.de> wrote this file.  As long as you retain
#   this notice you can do whatever you want with this stuff. If we meet some day,
#   and you think this stuff is worth it, you can buy me a beer in return.
#   ----------------------------------------------------------------------------
import unittest
from pathlib import Path

from finalcif.datafiles.saint import SaintListFile
from finalcif.tools.misc import unify_line_endings

data = Path('.')


class MyTestCase(unittest.TestCase):

    def test_saint_repr(self):
        output = 'Version: SAINT V8.38A, file: TB_fs20_v1_0m._ls\n' \
                 'Number of samples: 1 with 1 components.\n' \
                 'Used Reflections: 9478\n' \
                 'min thata: 2.33\n' \
                 'max theta: 27.3635\n' \
                 'min 2 theta: 4.660\n' \
                 'max 2 theta: 54.727\n' \
                 'Twin integration False\n'
        saint = SaintListFile(name_patt='TB_fs20_v1_0m._ls', directory=data / 'test-data')
        self.assertEqual(unify_line_endings(output), unify_line_endings(str(saint)))


if __name__ == '__main__':
    unittest.main()