|
| 1 | +""" |
| 2 | +Unit tests for pyobjcryst.reflectionprofile bindings. |
| 3 | +
|
| 4 | +TODO: |
| 5 | +- ReflectionProfile.GetProfile |
| 6 | +- ReflectionProfile.GetFullProfileWidth |
| 7 | +- ReflectionProfile.XMLOutput / XMLInput |
| 8 | +- ReflectionProfile.CreateCopy |
| 9 | +""" |
| 10 | + |
| 11 | +import unittest |
| 12 | +import pytest |
| 13 | +import numpy as np |
| 14 | + |
| 15 | +from pyobjcryst.powderpattern import PowderPattern |
| 16 | + |
| 17 | + |
| 18 | +class TestReflectionProfile(unittest.TestCase): |
| 19 | + """Tests for ReflectionProfile methods""" |
| 20 | + |
| 21 | + @pytest.fixture(autouse=True) |
| 22 | + def prepare_fixture(self, loadcifdata): |
| 23 | + self.loadcifdata = loadcifdata |
| 24 | + |
| 25 | + def setUp(self): |
| 26 | + """Set up a ReflectionProfile instance for testing.""" |
| 27 | + x = np.linspace(0, 40, 8001) |
| 28 | + c = self.loadcifdata("paracetamol.cif") |
| 29 | + |
| 30 | + self.pp = PowderPattern() |
| 31 | + self.pp.SetWavelength(0.7) |
| 32 | + self.pp.SetPowderPatternX(np.deg2rad(x)) |
| 33 | + self.pp.SetPowderPatternObs(np.ones_like(x)) |
| 34 | + |
| 35 | + self.ppd = self.pp.AddPowderPatternDiffraction(c) |
| 36 | + |
| 37 | + self.profile = self.ppd.GetProfile() |
| 38 | + |
| 39 | + def test_get_computed_profile(self): |
| 40 | + assert True |
| 41 | + |
| 42 | + def test_get_profile_width(self): |
| 43 | + assert True |
| 44 | + |
| 45 | + def test_create_copy(self): |
| 46 | + assert True |
| 47 | + |
| 48 | + def test_xml_input(self): |
| 49 | + assert True |
| 50 | + |
| 51 | + def test_xml_output(self): |
| 52 | + assert True |
| 53 | + |
| 54 | + |
| 55 | +if __name__ == "__main__": |
| 56 | + unittest.main() |
0 commit comments