def test_tobject_formatter_tprofile(self): """Should successfully return a TProfile representation.""" rep = response_formatters.tobject_formatter(self.tprofile) exp = dict( success=True, data=dict( name='test_tprofile', title='Test TProfile', object_class='TProfile', data=response_formatters.th1_formatter(self.tprofile) ) ) self.assertEqual(rep, exp)
def test_tobject_formatter_th2(self): """Should successfully return a TH1 representation.""" rep = response_formatters.tobject_formatter(self.th2) exp = dict( success=True, data=dict( name='test_th2f', title='Test TH2F', object_class='TH2F', data=response_formatters.th2_formatter(self.th2) ) ) self.assertEqual(rep, exp)
def test_tobject_formatter_unknown_tobject(self): """Should raise TypeError for an unsupported TObject.""" with self.assertRaises(TypeError): response_formatters.tobject_formatter(self.taxis)