def test_generate_stub_configtype(self): schema = Schema() schema.x = VirtualField(lambda x: None) schema.y = StringField() Thing = schema.make_type('Thing') stub = generate_stub(Thing).split('\n') assert 'class Thing(cincoconfig.core.ConfigType):' in stub assert ' x: typing.Any' in stub assert ' y: str' in stub assert ' def __init__(self, y: str): ...' in stub
def test_make_type(self, mock_make_type): schema = Schema() retval = mock_make_type.return_value assert schema.make_type('asdf', module='qwer', key_filename='zxcv') is retval mock_make_type.assert_called_once_with(schema, 'asdf', 'qwer', 'zxcv')