Ejemplo n.º 1
0
 def setUpClass(cls):
     cls.OPTIONS = [
         Option(option_type=StringOption,
                value='hello',
                alternate_value='world',
                invalid_value=42,
                invalid_json_value='9000',
                invalid_raw_value=None),
         Option(option_type=make_option_type(StringOption,
                                             allow_empty=False),
                value='hello',
                alternate_value='world',
                invalid_value='',
                invalid_json_value='9000',
                invalid_raw_value=None)
     ]
Ejemplo n.º 2
0
 def setUpClass(cls):
     cls.OPTIONS = [
         Option(option_type=PathOption,
                value=Path('/a'),
                alternate_value=Path('/b'),
                invalid_value=42,
                invalid_json_value='true',
                invalid_raw_value=None),
         Option(option_type=make_option_type(PathOption,
                                             path_type=PurePosixPath),
                value=PurePosixPath('/a'),
                alternate_value=PurePosixPath('b'),
                invalid_value=42,
                invalid_json_value='42',
                invalid_raw_value=None)
     ]
Ejemplo n.º 3
0
 def setUpClass(cls):
     cls.OPTIONS = [
         Option(option_type=FloatOption,
                value=42.0,
                alternate_value=9000.0,
                invalid_value='hello',
                invalid_json_value='true',
                invalid_raw_value='world')
     ]
Ejemplo n.º 4
0
 def setUpClass(cls):
     cls.OPTIONS = [
         Option(option_type=make_option_type(BooleanOption),
                value=True,
                alternate_value=False,
                invalid_value='42',
                invalid_json_value='1.0',
                invalid_raw_value='hello'),
     ]
Ejemplo n.º 5
0
 def setUpClass(cls):
     cls.OPTIONS = [
         Option(option_type=IntOption,
                value=42,
                alternate_value=9000,
                invalid_value='hello',
                invalid_json_value='"world"',
                invalid_raw_value='hello world')
     ]
Ejemplo n.º 6
0
 def setUpClass(cls):
     cls.OPTIONS = [
         Option(
             option_type=make_option_type(ArrayOption,
                                          value_option=IntOption('_')),
             value=[42],
             alternate_value=[9000],
             invalid_value=['hello'],
             invalid_json_value='["world"]',
             invalid_raw_value=['hello'],
         ),
         Option(
             option_type=make_option_type(ArrayOption,
                                          value_option=FloatOption('_')),
             value=[1.0],
             alternate_value=[2.0],
             invalid_value='hello',
             invalid_json_value='["world"]',
             invalid_raw_value=['hello'],
         )
     ]
Ejemplo n.º 7
0
 def setUpClass(cls):
     cls.OPTIONS = [
         Option(option_type=make_option_type(EnumOption, enum_type=IntEnum),
                value=IntEnum.A,
                alternate_value=IntEnum.B,
                invalid_value=FloatEnum.A,
                invalid_json_value='"string"',
                invalid_raw_value='string'),
         Option(option_type=make_option_type(EnumOption,
                                             enum_type=FloatEnum),
                value=FloatEnum.A,
                alternate_value=FloatEnum.B,
                invalid_value='string',
                invalid_json_value='"string"',
                invalid_raw_value='string'),
         Option(option_type=make_option_type(EnumOption,
                                             enum_type=StringEnum),
                value=StringEnum.A,
                alternate_value=StringEnum.B,
                invalid_value=IntEnum.A,
                invalid_json_value='42',
                invalid_raw_value=None),
         Option(option_type=make_option_type(EnumOption,
                                             enum_type=PathEnum,
                                             value_option=PathOption('_')),
                value=PathEnum.A,
                alternate_value=PathEnum.B,
                invalid_value=IntEnum.A,
                invalid_json_value='42',
                invalid_raw_value=None),
         Option(option_type=make_option_type(EnumOption,
                                             enum_type=PathEnum),
                value=PathEnum.A,
                alternate_value=PathEnum.B,
                invalid_value=IntEnum.A,
                invalid_json_value='42',
                invalid_raw_value=None)
     ]
Ejemplo n.º 8
0
 def setUpClass(cls):
     cls.OPTIONS = [
         Option(option_type=make_option_type(DictOption,
                                             value_option=IntOption('_')),
                value={'key1': 42},
                alternate_value={'key2': 9000},
                invalid_value={'key2': 'hello'},
                invalid_json_value='{"key2": "world"}',
                invalid_raw_value={'key2': 'hello'}),
         Option(option_type=make_option_type(DictOption,
                                             value_option=FloatOption('_')),
                value={'key1': 1.0},
                alternate_value={'key2': 2.0},
                invalid_value={'key2': 'hello'},
                invalid_json_value='"world"',
                invalid_raw_value={'key2': 'hello'}),
         Option(option_type=make_option_type(DictOption,
                                             value_option=FloatOption('_')),
                value={'key1': 1.0},
                alternate_value={'key2': 2.0},
                invalid_value='hello',
                invalid_json_value='"world"',
                invalid_raw_value={'key2': 'hello'}),
     ]