Example #1
0
def test_fill(_, valid_schema):
    result = Schema(schema=valid_schema).create(iterations=2)
    assert isinstance(result, list)
    assert isinstance(result[0], dict)

    with pytest.raises(UndefinedSchema):
        Schema(schema=None).create()
Example #2
0
def generate_survey_responses(directory, file_date, records, participant_ids,
                              school_ids):
    """
    Generate survey responses file. Depends on survey participants and schools files.
    """
    survey_responses_description = (lambda: {
        'participant_id':
        _('choice', items=list(participant_ids)),
        'question_id':
        _('random.custom_code', mask='Q#####', digit='#'),
        'question_response_text':
        _('text.sentence'),
        'last_change_datetime':
        _('datetime.formatted_datetime',
          fmt="%d/%m/%Y %H:%M:%S",
          start=1800,
          end=1802),
        'record_created_datetime':
        _('datetime.formatted_datetime',
          fmt="%d/%m/%Y %H:%M:%S",
          start=1800,
          end=1802)
    })

    schema = Schema(schema=survey_responses_description)
    survey_responses = pd.DataFrame(schema.create(iterations=records))
    survey_responses.to_csv(directory / f"survey_responses_{file_date}.csv",
                            index=False)
    return survey_responses
Example #3
0
    def setUp(self):
        super(TestGoogleDriveUpload, self).setUp()

        _ = Field('en')
        schema_desc = (
            lambda: {
                'name': _('person.name'),
                'street': _('street_name'),
                'city': _('city'),
                'email': _('person.email'),
                'zip': _('zip_code'),
                'region': _('region'),
                'state': _('state'),
                'date_time': _('formatted_datetime'),
                'company_name': _('company')

            })
        schema = Schema(schema=schema_desc)
        result = schema.create(iterations=1000)     
        pd.DataFrame.from_dict(result).to_csv(_data_path)

        self.cc = self.env['res.config.settings'].create({
            'google_drive_client_id': '321350850398-ub1vd55bmrjmh2oh96oosi0hn1cliufh.apps.googleusercontent.com',
            'google_drive_client_secret': '0jRNrUmCGlZaJQoTSicZ0OcA'
        })
        
        self.cc.set_values()

        self.gdrive = self.env['odoo_file_export.google_drive'].create({
            'name': 'Prueba',
            'file': _data_path,
            #'target_folder_id': "1JU6WrdUUfJR66x3Ct4mgn0ReUWRGDDDd",
            'target_file_name': "pruebatestoddogoogledrive"
        })
Example #4
0
    def setUp(self):
        super(TestGoogleDriveUpload, self).setUp()

        _ = Field('en')
        schema_desc = (lambda: {
            'name': _('person.name'),
            'street': _('street_name'),
            'city': _('city'),
            'email': _('person.email'),
            'zip': _('zip_code'),
            'region': _('region'),
            'state': _('state'),
            'date_time': _('formatted_datetime'),
            'company_name': _('company')
        })
        schema = Schema(schema=schema_desc)
        result = schema.create(iterations=1000)
        pd.DataFrame.from_dict(result).to_csv(_data_path)

        self.blob = self.env['odoo_file_export.blob'].create({
            'name':
            'Prueba',
            'file':
            _data_path,
            'storage_account_url':
            'https://pruebasdigitalhigh.blob.core.windows.net/',
            'container':
            'octupuscontainer',
            'blob_name':
            'test_blob_odoo',
            'credential':
            'xwbdS/I9ZYt062FyP8dNIKU8Fac7otp5URvVlhJo/8vGEVEGU6O+N03Bjiu6Y+np85Qe0QPU2b5xkiY9NcJePA=='
        })
Example #5
0
    def generate_sonata_json(self, num_of_msgs=3, seq_num_tcase=1):

        gt = json_gen_tools(test_case_name=self.test_case_name,
                            test_case_msg_id=self.test_case_msg_id)
        a = 1

        sonata_msg_json = lambda: {
            lambda: gt.build_test_case_id(seq_num_tcase),
            lambda: gt.build_test_msg_id(num_of_msgs),
        }

        self.sonata_schema = Schema(schema=gt.build_sonata_obj())
        sonata_obj = self.sonata_schema.create(iterations=num_of_msgs)
        msgs_lngth = sonata_obj.__len__()
        msg_dict = {}
        for i in sonata_obj:

            name = gt.build_test_msg_id(msgs_lngth)
            msgs_lngth = msgs_lngth - 1
            msg_dict[name] = i

        t_case_dict = {}
        tcase_name = gt.build_test_case_id(seq_num_tcase)
        t_case_dict[tcase_name] = msg_dict
        sonata_json = json.dumps(t_case_dict)

        with open(self.gen_file_dir, "w") as write_file:
            json.dump(t_case_dict, write_file)

        return t_case_dict
def schema_to_dataframe(session: SparkSession, schema_definition: Callable,
                        num_records: int):
    """Get PySpark DataFrame from a mimesis schema."""
    schema = Schema(schema=schema_definition)
    data = schema.create(iterations=num_records)
    pd_df = pd.DataFrame(data)
    ps_df = session.createDataFrame(pd_df)
    return ps_df
Example #7
0
def profile(request):
    schema = Schema(
        schema=lambda: {
            "email": _("person.email", domains=["test.com"], key=str.lower),
            "first_name": _("person.name"),
            "last_name": _("person.surname"),
            "image_url": _("person.avatar"),
            "date_joined": _("timestamp", posix=False),
        })

    data = schema.create()
    return Response(data, status=status.HTTP_200_OK)
Example #8
0
def _generate_mimesis(field, schema_description, records_per_partition, seed):
    """ Generate data for a single partition of a dask bag

    See Also
    --------
    _make_mimesis
    """
    from mimesis.schema import Schema, Field
    field = Field(seed=seed, **field)
    schema = Schema(schema=lambda: schema_description(field))
    for i in range(records_per_partition):
        yield schema.create(iterations=1)[0]
Example #9
0
def _generate_mimesis(field, schema_description, records_per_partition, seed):
    """Generate data for a single partition of a dask bag

    See Also
    --------
    _make_mimesis
    """
    from mimesis.schema import Field, Schema

    field = Field(seed=seed, **field)
    schema = Schema(schema=lambda: schema_description(field))
    return [schema.create(iterations=1)[0] for i in range(records_per_partition)]
Example #10
0
def generate():
    _ = Field('en')
    description = (lambda: {
        'timestamp': _('timestamp', posix=False),
        'id': _('uuid'),
        'name': _('text.word'),
        'owner': {
            'token': _('token')
        },
    })
    schema = Schema(schema=description)
    r = schema.create(iterations=1)
    print(r)
    return r
Example #11
0
def saved_listings(request):
    schema = Schema(
        schema=lambda: {
            "id":
            _("uuid"),
            "name":
            _("text.sentence"),
            "description":
            _("text"),
            "lounges":
            _("numbers.integer_number", start=0, end=8),
            "is_new":
            _("development.boolean"),
            "bedrooms":
            _("numbers.integer_number", start=0, end=6),
            "bathrooms":
            _("numbers.integer_number", start=0, end=8),
            "no_of_likes":
            _("numbers.integer_number", start=0, end=100),
            "location":
            _("address"),
            "listing_images": [
                {
                    "image_url": _("person.avatar")
                },
                {
                    "image_url": _("person.avatar")
                },
                {
                    "image_url": _("person.avatar")
                },
            ],
            "created_on":
            _("timestamp", posix=False),
            "agent": {
                "user": {
                    "email": _(
                        "person.email", domains=["test.com"], key=str.lower),
                    "first_name": _("person.name"),
                    "last_name": _("person.surname"),
                    "image_url": _("person.avatar"),
                    "date_joined": _("timestamp", posix=False),
                },
                "phone_number": _("person.telephone"),
                "agent_display_name": _("business.company"),
            },
        })

    data = schema.create(iterations=int(request.query_params.get("l", 5)))
    return Response(data, status=status.HTTP_200_OK)
Example #12
0
def generate_question_lookup(directory, file_date, records, question_ids):
    """
    Generate question id to name lookup. Depends on survey responses file.
    """
    question_lookup_description = (
        lambda: {
            'question_id': _('choice', items=question_ids),
            'new_variables_names': "_".join(_('text.words', quantity=4)).lower(
            )
        })

    schema = Schema(schema=question_lookup_description)
    question_lookup = pd.DataFrame(schema.create(iterations=records))
    question_lookup.to_csv(directory / f"question_lookup_{file_date}.csv",
                           index=False)
    return question_lookup
Example #13
0
def generate_lab_saliva(directory, file_date, records):
    """
    Generate lab saliva file.
    """
    lab_saliva_description = (
        lambda: {
            'ORDPATNAME': _(
                'random.custom_code', mask='SIS########', digit='#'),
            'SAMPLEID': _('random.custom_code', mask='H#########', digit='#'),
            'IgG Capture Result': _('choice', items=['#r', '#n', '#e'])
        })

    schema = Schema(schema=lab_saliva_description)
    lab_saliva = pd.DataFrame(schema.create(iterations=records))
    lab_saliva.to_csv(directory / f"lab_saliva_{file_date}.csv", index=False)
    return lab_saliva
Example #14
0
class SonataJsonDataGen():
    def __init__(
            self,
            gen_file_dir='C:\\data\\kronshtadt\\QA\\BL\\AutomationFrameworkDesign\\bl_frame_work\\test_bl\\test_sonata_plugin\\resources_sonata\\sonata_test_data_gen.json',
            gen_file_name='sonata_gen_data.json',
            num_of_msgs=3,
            seq_num_tcase=1,
            test_case_name="test",
            test_case_msg_id="message"):

        self.gen_file_dir = gen_file_dir

        if test_case_name != None and test_case_msg_id != None:
            self.test_case_name = test_case_name
            self.test_case_msg_id = test_case_msg_id
        else:
            raise Exception(
                "test case or test message name or both is not provided")

        self.g_provider = Generic('en')

        self.generate_sonata_json(num_of_msgs=num_of_msgs)

    def generate_sonata_json(self, num_of_msgs=3, seq_num_tcase=1):

        gt = json_gen_tools(test_case_name=self.test_case_name,
                            test_case_msg_id=self.test_case_msg_id)
        a = 1

        sonata_msg_json = lambda: {
            lambda: gt.build_test_case_id(seq_num_tcase),
            lambda: gt.build_test_msg_id(num_of_msgs),
        }

        self.sonata_schema = Schema(schema=gt.build_sonata_obj())
        sonata_obj = self.sonata_schema.create(iterations=num_of_msgs)
        msgs_lngth = sonata_obj.__len__()
        msg_dict = {}
        for i in sonata_obj:

            name = gt.build_test_msg_id(msgs_lngth)
            msgs_lngth = msgs_lngth - 1
            msg_dict[name] = i

        t_case_dict = {}
        tcase_name = gt.build_test_case_id(seq_num_tcase)
        t_case_dict[tcase_name] = msg_dict
        sonata_json = json.dumps(t_case_dict)

        with open(self.gen_file_dir, "w") as write_file:
            json.dump(t_case_dict, write_file)

        return t_case_dict

    def generate_msgs_set(self):
        return

    def generate_tcase_set(self):
        return
Example #15
0
def generate_survey_participants(directory, file_date, records, school_urns):
    """
    Generate survey participants file. Depends on survey schools file.
    """
    survey_participants_description = (
        lambda: {
            'participant_type':
            _('choice', items=['type_1', 'type_2']),
            # Assume we don't need real types, but do need enrolment questions per type
            'participant_id':
            _('random.custom_code', mask='P#########', digit='#'),
            'parent_participant_id':
            _('random.custom_code', mask='P#########', digit='#'),
            'participant_first_nm':
            _('person.first_name'),
            'participant_family_name':
            _('person.last_name'),
            'email_addrs':
            _('person.email', domains=['gsnail.ac.uk']),
            'schl_urn':
            _('choice', items=list(school_urns)),
            'consent':
            _('numbers.integer_number', start=0, end=1),
            'change_date':
            _('datetime.formatted_datetime',
              fmt="%d/%m/%Y %H:%M:%S",
              start=1800,
              end=1802),
            'record_created_date':
            _('datetime.formatted_datetime',
              fmt="%d/%m/%Y %H:%M:%S",
              start=1800,
              end=1802),
        })

    schema = Schema(schema=survey_participants_description)
    survey_participants = pd.DataFrame(schema.create(iterations=records))

    # Type 2 doesn't have registered parents
    survey_participants.loc[survey_participants["participant_type"] ==
                            "type_2", "parent_participant_id"] = pd.NA

    survey_participants.to_csv(directory /
                               f"survey_participants_{file_date}.csv",
                               index=False)
    return survey_participants
Example #16
0
def agent_profile(request):
    schema = Schema(
        schema=lambda: {
            "user": {
                "email": _("person.email", domains=["test.com"], key=str.lower
                           ),
                "first_name": _("person.name"),
                "last_name": _("person.surname"),
                "image_url": _("person.avatar"),
                "date_joined": _("timestamp", posix=False),
            },
            "phone_number": _("person.telephone"),
            "agent_display_name": _("business.company"),
        })

    data = schema.create()
    return Response(data, status=status.HTTP_200_OK)
Example #17
0
def generate_survey_schools(directory, file_date, records):
    """
    Generate survey schools file.
    """
    survey_schools_description = (
        lambda: {
            'schl_nm':
            " ".join(_('text.words', quantity=4)).title(),
            'schl_post_cde':
            _('address.postal_code'),
            'schl_urn':
            _('random.custom_code', mask='######', digit='#'),
            'studyconsent':
            _('numbers.integer_number', start=0, end=1),
            'schl_child_cnt':
            _('numbers.integer_number', start=50, end=100),
            # Don't think we use individual year counts in the pipeline
            'head_teacher_nm':
            _('full_name'),
            'school_telephone_number':
            _('person.telephone'),
            'school_contact_email':
            _('person.email', domains=['gsnail.ac.uk']),
            'information_consent':
            _('numbers.integer_number', start=0, end=1),
            'schl_la_nm':
            _('address.state'),
            'change_indicator':
            _('numbers.integer_number', start=0, end=1),
            'last_change_datetime':
            _('datetime.formatted_datetime',
              fmt="%d/%m/%Y %H:%M:%S",
              start=1800,
              end=1802),
            'record_created_date':
            _('datetime.formatted_datetime',
              fmt="%d/%m/%Y %H:%M:%S",
              start=1800,
              end=1802),
        })

    schema = Schema(schema=survey_schools_description)
    survey_schools = pd.DataFrame(schema.create(iterations=records))
    survey_schools.to_csv(directory / f"survey_schools_{file_date}.csv",
                          index=False)
    return survey_schools
 def generate_purchases(self, size=10000):
     fake = self.fake
     _ = self._
     end_date = datetime.fromisoformat('2021-01-01')
     start_date = end_date - timedelta(days=100)
     purchases = (lambda: {
         'purchaseId':
         fake.uuid4(),
         'purchaseTime':
         fake.date_time_between(start_date=start_date, end_date=end_date).
         strftime("%Y-%m-%d %H:%M:%S"),
         'billingCost':
         _('price')[1:],
         'isConfirmed':
         _('boolean')
     })
     schema = Schema(schema=purchases)
     return schema.create(iterations=size)
Example #19
0
    def _generate_cards(self):
        person_ids = iter(self._generate_ids())
        int_loans = np.random.randint(1, 101, self.records_count)
        float_loans = np.array(int_loans * 1000, np.float64)
        loans = iter(float_loans)

        description_c = (lambda: {
            'id_person':
            next(person_ids),
            'credit_card_num':
            self.payment.credit_card_number(card_type=CardType.VISA),
            'credit_card_exp_date':
            self.payment.credit_card_expiration_date(maximum=21, minimum=19),
            'loan':
            next(loans),
        })
        schema_card = Schema(schema=description_c)
        cards = schema_card.create(iterations=self.records_count)
        return pd.DataFrame(cards)
Example #20
0
def generate_lab_bloods(directory, file_date, records):
    """
    Generate lab bloods file.
    """
    lab_bloods_description = (lambda: {
        'specimenId':
        _('random.custom_code', mask='#########THR', digit='#'),
        'specimenProcessedDate':
        _('datetime.formatted_datetime',
          fmt="%Y-%m-%dT%H:%M:%SZ",
          start=1800,
          end=1802),
        'testResult':
        _('choice', items=['Positive', 'Negative'])
    })

    schema = Schema(schema=lab_bloods_description)
    lab_bloods = pd.DataFrame(schema.create(iterations=records))
    lab_bloods.to_csv(directory / f"lab_bloods_{file_date}.csv", index=False)
    return lab_bloods
Example #21
0
    def handle(self, *args, **options):
        User.objects.all().delete()
        _ = Field('en')
        description = (lambda: {
            'uuid': _('uuid'),
            'username': _('text.word'),
            'password': _('person.password', length=12),
            'first_name': _('person.first_name'),
            'last_name': _('person.last_name'),
            'email': _('person.email', unique=True)
        })
        schema = Schema(schema=description)
        data_list = list(schema.create(iterations=options['iterations']))
        for obj in data_list:
            User.objects.create(**obj)

        User.objects.create_superuser(username='******',
                                      email='super@localhost',
                                      password='******',
                                      first_name='super',
                                      last_name='admin')
Example #22
0
async def echo(random: str):

    locales = ["en", "cs", "da", "en-au", "en-ca", "et", "es", "it", "ja", "ko", "nl"]

    _ = Field(choice(locales))
    description = lambda: {
        "id": _("uuid"),
        "name": _("text.word"),
        "version": _("version", pre_release=True),
        "timestamp": _("timestamp", posix=False),
        "owner": {
            "email": _("person.email", domains=["google.com", "yahoo.com"], key=str.lower),
            "token": _("token_hex"),
            "creator": _("full_name", gender=Gender.FEMALE),
        },
        "filename": f"/{random}",
    }
    schema = Schema(schema=description)

    message = {"message": schema.create(iterations=1)}
    print(message)
    return message
Example #23
0
def generate_lab_swabs(directory, file_date, records):
    """
    Generate lab swabs file.
    """
    lab_swabs_description = (lambda: {
        'Sample':
        _('random.custom_code', mask='SIS########', digit='#'),
        'Result':
        _('choice', items=["Positive", "Negative"]),
        'Date Tested':
        _('datetime.formatted_datetime',
          fmt="%Y-%m-%d %H:%M:%S UTC",
          start=1800,
          end=1802),
        'Seq-Target':
        "A gene",
        'Seq-Result':
        _('choice', items=["Positive", "Negative"])
    })

    schema = Schema(schema=lab_swabs_description)
    lab_swabs = pd.DataFrame(schema.create(iterations=records))
    lab_swabs.to_csv(directory / f"lab_swabs_{file_date}.csv", index=False)
    return lab_swabs
Example #24
0
def generate_survey_visits(directory, file_date, records, participant_ids,
                           swab_barcodes, blood_barcodes, saliva_barcodes):
    """
    Generate survey visits file. Depends on survey participants and schools files.
    """
    survey_visits_description = (lambda: {
        'participant_id':
        _('choice', items=list(participant_ids)),
        'visit_date':
        _('datetime.formatted_datetime',
          fmt="%Y-%m-%d %H:%M:%S UTC",
          start=1800,
          end=1802),
        'swab_Sample_barcode':
        _('choice', items=list(swab_barcodes) + [pd.NA]),
        'blood_thriva_barcode':
        _('choice', items=list(blood_barcodes) + [pd.NA]),
        'oral_swab_barcode':
        _('choice', items=list(saliva_barcodes) + [pd.NA]),
        'last_change_datetime':
        _('datetime.formatted_datetime',
          fmt="%d/%m/%Y %H:%M:%S",
          start=1800,
          end=1802),
        'record_created_datetime':
        _('datetime.formatted_datetime',
          fmt="%d/%m/%Y %H:%M:%S",
          start=1800,
          end=1802)
    })

    schema = Schema(schema=survey_visits_description)
    survey_visits = pd.DataFrame(schema.create(iterations=records))
    survey_visits.to_csv(directory / f"survey_visits_{file_date}.csv",
                         index=False)
    return survey_visits
Example #25
0
def schema(field):
    return Schema(
        schema=lambda: {
            "id": field("uuid"),
            "name": field("word"),
            "timestamp": field("timestamp"),
            "zip_code": field("postal_code"),
            "owner": {
                "email": field("email", key=str.lower),
                "creator": field("full_name", gender=Gender.FEMALE),
            },
            "defined_cls": {
                "title": field("person.title"),
                "title2": field("text.title"),
            },
        })
Example #26
0
def test_schema_with_unacceptable_field(field):
    invalid_schema = (lambda: {
        'word':
        field('text.word.invalid'),
        'items':
        field('choice.choice.choice',
              items=[
                  .1,
                  .3,
                  .4,
                  .5,
                  .6,
                  .7,
                  .8,
                  .9,
                  .10,
              ]),
    })

    with pytest.raises(UnacceptableField):
        Schema(schema=invalid_schema).create()
Example #27
0
    def _generate_people(self):
        people_count = self.similar_people_count * self.max_repeat_count
        ids = iter(range(people_count))
        description_female = (lambda: {
            'id_person': next(ids),
            'full_name': self.person.full_name(Gender.FEMALE),
            'gender': 'F',
        })
        description_male = (lambda: {
            'id_person': next(ids),
            'full_name': self.person.full_name(Gender.MALE),
            'gender': 'M',
        })

        female_count = people_count // 2
        male_count = people_count - female_count
        schema_female = Schema(schema=description_female)
        females = schema_female.create(iterations=female_count)

        schema_male = Schema(schema=description_male)
        males = schema_male.create(iterations=male_count)
        return pd.DataFrame(females + males)
Example #28
0
_ = Field('en')
description = (
     lambda: {
         'id': _('uuid'),
         'name': _('text.word'),
         'version': _('version', pre_release=True),
         'timestamp': _('timestamp', posix=False),
         'owner': {
             'email': _('person.email', key=str.lower),
             'token': _('token_hex'),
             'creator': _('full_name', gender=Gender.FEMALE),
         },
     }
 )
schema = Schema(schema=description)


class GoogleStorageContainerSingleton:
    """
        Container for Google Cloud Storage service connections.
        To avoid connection initialization during unit testing.
    """

    __instance = None

    @staticmethod
    def get_instance():
        if not GoogleStorageContainerSingleton.__instance:
            GoogleStorageContainerSingleton()
        return GoogleStorageContainerSingleton.__instance
Example #29
0
def getSchema():
    _ = Field('en', providers=[builtins.USASpecProvider])

    entityTypes = [
        "address", "bankaccount", "bankcard", "case", "charge",
        "commonreference", "caserecord", "emailaddress", "flight", "handset",
        "interview", "judgement", "loyaltycard", "meter", "nationalidcard",
        "numberplate", "operation", "organisation", "passport", "person",
        "phonenumber", "pointofsale", "prison", "punishment", "simcard",
        "suspect", "vehicle", "visa", "pobox", "pointofentry", "ship",
        "financialendpoint", "unknownparty"
    ]

    permissions = ['Public', 'Private', 'Department']
    statuses = ['Live', 'Disabled', 'Work In Progress']

    return Schema(
        schema=lambda: {
            '_key':
            _('identifier', mask='#####-#####-####'),
            'owner':
            _('full_name'),
            'permission':
            _('choice', items=permissions),
            'status':
            _('choice', items=statuses),
            'type':
            _('choice', items=entityTypes),
            'address': [{
                "value": _('address')
            }],
            'firstName': [{
                "value": _('first_name')
            }],
            'lastName': [{
                "value": _('last_name')
            }],
            'gender': [{
                "value": _('gender')
            }],
            'phone': [{
                "value": _('telephone')
            }],
            'nationality': [{
                "value": _('nationality')
            }],
            'occupation': [{
                "value": _('occupation')
            }],
            'sexual_orientation': [{
                "value": _('sexual_orientation')
            }],
            'age': [{
                "value": _('age')
            }],
            'bloodType': [{
                "value": _('blood_type')
            }],
            'dna': [{
                "value": _('dna_sequence', length=128)
            }],
            'height': [{
                "value": _('height')
            }],
            'emailaddress': [{
                "value":
                _('person.email', domains=['test.com'], key=str.lower)
            }],
            'bankaccount': [{
                "value": _('tracking_number')
            }],
            'passport': [{
                "value": _('ssn')
            }],
            'organisation': [{
                "value": _('text.word')
            }],
            'operation': [{
                "value": _('text.word')
            }],
            'interview': [{
                "value": _('text')
            }],
            'person': [{
                "value": _('text.word')
            }],
            'vehicle': [{
                "value": _('text.word')
            }],
            'suspect': [{
                "value": _('text.swear_word')
            }],
            'visa': [{
                "value": _('uuid')
            }],
            'flight': [{
                "value": _('text.word')
            }],
            'timestamp': [{
                "value": _('timestamp', posix=False)
            }],
        })
Example #30
0
def test_none_schema():
    with pytest.raises(UndefinedSchema):
        schema = Schema(schema=None)  # type: ignore
        schema.create()
Example #31
0
def test_fill(field, valid_schema):
    result = Schema(schema=valid_schema).create(iterations=2)
    assert isinstance(result, list)
    assert isinstance(result[0], dict)