def setUp(self): self.builder = UBMatrixBuilder() self.valid_matrix = {u'_diffrn_orient_matrix_ub_11': u'-0.03', u'_diffrn_orient_matrix_ub_12': u'0.13', u'_diffrn_orient_matrix_ub_13': u'0.31', u'_diffrn_orient_matrix_ub_21': u'0.01', u'_diffrn_orient_matrix_ub_22': u'-0.31', u'_diffrn_orient_matrix_ub_23': u'0.14', u'_diffrn_orient_matrix_ub_31': u'0.34', u'_diffrn_orient_matrix_ub_32': u'0.02', u'_diffrn_orient_matrix_ub_33': u'0.02'}
class UBMatrixBuilderTest(unittest.TestCase): def setUp(self): self.builder = UBMatrixBuilder() self.valid_matrix = { u'_diffrn_orient_matrix_ub_11': u'-0.03', u'_diffrn_orient_matrix_ub_12': u'0.13', u'_diffrn_orient_matrix_ub_13': u'0.31', u'_diffrn_orient_matrix_ub_21': u'0.01', u'_diffrn_orient_matrix_ub_22': u'-0.31', u'_diffrn_orient_matrix_ub_23': u'0.14', u'_diffrn_orient_matrix_ub_31': u'0.34', u'_diffrn_orient_matrix_ub_32': u'0.02', u'_diffrn_orient_matrix_ub_33': u'0.02' } def test_getUBMatrix_invalid(self): for key in self.valid_matrix: tmp = self.valid_matrix.copy() del tmp[key] self.assertRaises(RuntimeError, self.builder._getUBMatrix, cifData=tmp) def test_getUBMatrix_correct(self): self.assertEqual(self.builder._getUBMatrix(self.valid_matrix), '-0.03,0.13,0.31,0.01,-0.31,0.14,0.34,0.02,0.02')
def setUp(self): self.builder = UBMatrixBuilder() self.valid_matrix = { u"_diffrn_orient_matrix_ub_11": u"-0.03", u"_diffrn_orient_matrix_ub_12": u"0.13", u"_diffrn_orient_matrix_ub_13": u"0.31", u"_diffrn_orient_matrix_ub_21": u"0.01", u"_diffrn_orient_matrix_ub_22": u"-0.31", u"_diffrn_orient_matrix_ub_23": u"0.14", u"_diffrn_orient_matrix_ub_31": u"0.34", u"_diffrn_orient_matrix_ub_32": u"0.02", u"_diffrn_orient_matrix_ub_33": u"0.02", }
class UBMatrixBuilderTest(unittest.TestCase): def setUp(self): self.builder = UBMatrixBuilder() self.valid_matrix = {u'_diffrn_orient_matrix_ub_11': u'-0.03', u'_diffrn_orient_matrix_ub_12': u'0.13', u'_diffrn_orient_matrix_ub_13': u'0.31', u'_diffrn_orient_matrix_ub_21': u'0.01', u'_diffrn_orient_matrix_ub_22': u'-0.31', u'_diffrn_orient_matrix_ub_23': u'0.14', u'_diffrn_orient_matrix_ub_31': u'0.34', u'_diffrn_orient_matrix_ub_32': u'0.02', u'_diffrn_orient_matrix_ub_33': u'0.02'} def test_getUBMatrix_invalid(self): for key in self.valid_matrix: tmp = self.valid_matrix.copy() del tmp[key] self.assertRaises(RuntimeError, self.builder._getUBMatrix, cifData=tmp) def test_getUBMatrix_correct(self): self.assertEqual(self.builder._getUBMatrix(self.valid_matrix), '-0.03,0.13,0.31,0.01,-0.31,0.14,0.34,0.02,0.02')
class UBMatrixBuilderTest(unittest.TestCase): def setUp(self): self.builder = UBMatrixBuilder() self.valid_matrix = { u"_diffrn_orient_matrix_ub_11": u"-0.03", u"_diffrn_orient_matrix_ub_12": u"0.13", u"_diffrn_orient_matrix_ub_13": u"0.31", u"_diffrn_orient_matrix_ub_21": u"0.01", u"_diffrn_orient_matrix_ub_22": u"-0.31", u"_diffrn_orient_matrix_ub_23": u"0.14", u"_diffrn_orient_matrix_ub_31": u"0.34", u"_diffrn_orient_matrix_ub_32": u"0.02", u"_diffrn_orient_matrix_ub_33": u"0.02", } def test_getUBMatrix_invalid(self): for key in self.valid_matrix: tmp = self.valid_matrix.copy() del tmp[key] self.assertRaises(RuntimeError, self.builder._getUBMatrix, cifData=tmp) def test_getUBMatrix_correct(self): self.assertEqual(self.builder._getUBMatrix(self.valid_matrix), "-0.03,0.13,0.31,0.01,-0.31,0.14,0.34,0.02,0.02")