示例#1
0
 def test_define_valid_case_insensitive_enum(self):
   ff.DEFINE_dict(
       "valid_case_sensitive",
       padding=ff.Enum("Same", ["same", "valid"], "enum field",
                       case_sensitive=False),
   )
   self.assertEqual(FLAGS.valid_case_sensitive, {"padding": "same"})
示例#2
0
 def test_define_invalid_case_sensitive_enum(self):
     with self.assertRaises(ValueError):
         ff.Enum("Same", ["same", "valid"], "enum field")
示例#3
0
 def test_define_valid_enum(self):
     ff.DEFINE_dict(
         "valid_enum",
         padding=ff.Enum("same", ["same", "valid"], "enum field"),
     )
     self.assertEqual(FLAGS.valid_enum, {"padding": "same"})