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"})
def test_define_invalid_case_sensitive_enum(self): with self.assertRaises(ValueError): ff.Enum("Same", ["same", "valid"], "enum field")
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"})