diff --git a/scripts/AbinsModules/Instruments/Instrument.py b/scripts/AbinsModules/Instruments/Instrument.py index 934dad3eaf9f7040943c4ed5ccc368997bc23d86..9f8ef4ccce0bc548174732db008d9aac4d389f19 100644 --- a/scripts/AbinsModules/Instruments/Instrument.py +++ b/scripts/AbinsModules/Instruments/Instrument.py @@ -20,7 +20,7 @@ class Instrument(object): :param input_data: data from which Q2 should be calculated :returns: numpy array with Q2 data """ - return None + raise NotImplementedError() def convolve_with_resolution_function(self, frequencies=None, bins=None, s_dft=None, scheme='auto'): """ @@ -37,8 +37,8 @@ class Instrument(object): 'auto' should select something sensible. :type scheme: str - """ - return None + """ + raise NotImplementedError() def __str__(self): return self._name diff --git a/scripts/test/Abins/AbinsInstrumentTest.py b/scripts/test/Abins/AbinsInstrumentTest.py new file mode 100644 index 0000000000000000000000000000000000000000..d7fa7d2f2cb3e2a4d5f0439f7f304dc74dbdfbfe --- /dev/null +++ b/scripts/test/Abins/AbinsInstrumentTest.py @@ -0,0 +1,25 @@ +# Mantid Repository : https://github.com/mantidproject/mantid +# +# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI, +# NScD Oak Ridge National Laboratory, European Spallation Source +# & Institut Laue - Langevin +# SPDX - License - Identifier: GPL - 3.0 + +from __future__ import (absolute_import, division, print_function) +import unittest + +from AbinsModules.Instruments.Instrument import Instrument + + +class AbinsInstrumentTest(unittest.TestCase): + def test_instrument_notimplemented(self): + instrument = Instrument() + + with self.assertRaises(NotImplementedError): + instrument.calculate_q_powder() + + with self.assertRaises(NotImplementedError): + instrument.convolve_with_resolution_function() + + +if __name__ == '__main__': + unittest.main() diff --git a/scripts/test/Abins/CMakeLists.txt b/scripts/test/Abins/CMakeLists.txt index b55939d572def47bcb0f8a3a9274fa56e00fb1fc..0b0e82fe5ea12b5ec0ea1507fd5f37629a6dd264 100644 --- a/scripts/test/Abins/CMakeLists.txt +++ b/scripts/test/Abins/CMakeLists.txt @@ -9,6 +9,7 @@ set ( TEST_PY_FILES AbinsCalculateSPowderTest.py AbinsDWSingleCrystalDataTest.py AbinsFrequencyPowderGeneratorTest.py + AbinsInstrumentTest.py AbinsIOmoduleTest.py AbinsKpointsDataTest.py AbinsLoadCASTEPTest.py