Example #1
0
 def test_complex_parse(self):
     self.assertEqual(
         utils.human_readable_label_vector([[("A", 4)], [("B", 4),
                                                         ("C", 3)],
                                            [("D", 2), ("E", 1), ("F", 1)],
                                            [("G", 4.3), ("H", 1)]]),
         "1 + A^4 + (B^4 * C^3) + (D^2 * E * F) + (G^4.3 * H)")
Example #2
0
 def test_complex_parse(self):
     self.assertEqual(
         utils.human_readable_label_vector([
             [("A", 4)],
             [("B", 4), ("C", 3)],
             [("D", 2), ("E", 1), ("F", 1)],
             [("G", 4.3), ("H", 1)]
         ]),
         "1 + A^4 + (B^4 * C^3) + (D^2 * E * F) + (G^4.3 * H)"
     )
Example #3
0
 def test_str_supplied(self):
     with self.assertRaises(TypeError):
         utils.human_readable_label_vector("")
Example #4
0
 def test_bool_supplied(self):
     for each in (True, False):
         with self.assertRaises(TypeError):
             utils.human_readable_label_vector(each)
Example #5
0
 def test_str_supplied(self):
     with self.assertRaises(TypeError):
         utils.human_readable_label_vector("")
Example #6
0
 def test_bool_supplied(self):
     for each in (True, False):
         with self.assertRaises(TypeError):
             utils.human_readable_label_vector(each)