def test_from_value_map(self): self.assertEqual({0: Std.OUT}, Std.from_str("0:1")) self.assertEqual({0: Std.OUT, 1: Std.OUT}, Std.from_str("0:1,1:1"))
def test_from_str_bad_input(self): bad_inputs = ["0:1,", "11", "0:1,1", "1,0:1"] for bad in bad_inputs: with self.subTest(bad=bad): with self.assertRaises(ValueError): Std.from_str(bad)
def test_from_value(self): self.assertEqual(Std.NONE, Std.from_str("0")) self.assertEqual(Std.OUT, Std.from_str("1")) self.assertEqual(Std.ERR, Std.from_str("2")) self.assertEqual(Std.ALL, Std.from_str("3"))