class InstrumentViewDecoderTest(GuiTest):
    def setUp(self):
        self.decoder = InstrumentViewDecoder()

    def test_decoder_is_in_decoder_factory(self):
        # Shows that the decoder has been registered on import of something from mantidqt.widget.instrumentview
        found_decoder = DecoderFactory.find_decoder("InstrumentView")
        self.assertIs(InstrumentViewDecoder, found_decoder.__class__)

    def test_decoder_decode_function_returns_none_when_obj_is_none(self):
        self.assertIs(None, self.decoder.decode(None))

    def test_nothing_is_thrown_when_decoding(self):
        CreateSampleWorkspace(OutputWorkspace="ws")
        self.decoder.decode(INSTRUMENT_VIEW_DICT)
Exemple #2
0
class InstrumentViewDecoderTest(unittest.TestCase):
    def setUp(self):
        self.decoder = InstrumentViewDecoder()

    def test_decoder_is_in_decoder_factory(self):
        # Shows that the decoder has been registered on import of something from mantidqt.widget.instrumentview
        found_decoder = DecoderFactory.find_decoder("InstrumentView")
        self.assertIs(InstrumentViewDecoder, found_decoder.__class__)

    def test_decoder_decode_function_returns_none_when_obj_is_none(self):
        self.assertIs(None, self.decoder.decode(None))

    def test_nothing_is_thrown_when_decoding(self):
        CreateSampleWorkspace(OutputWorkspace="ws")
        self.decoder.decode(INSTRUMENT_VIEW_DICT)
 def setUp(self):
     self.decoder = InstrumentViewDecoder()
Exemple #4
0
 def setUp(self):
     self.decoder = InstrumentViewDecoder()
Exemple #5
0
 def setUp(self):
     self.encoder = InstrumentViewEncoder()
     CreateSampleWorkspace(OutputWorkspace="ws")
     self.instrumentView = InstrumentViewDecoder().decode(
         INSTRUMENT_VIEW_DICT)