Skip to content

Commit

Permalink
#236: Move InvestigationParameter method into its generator class
Browse files Browse the repository at this point in the history
- No functionality change, just to make this function styled like all the others
  • Loading branch information
MRichards99 committed Jun 4, 2021
1 parent 28fd5eb commit f211b44
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions util/icat_db_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,19 +527,18 @@ class InvestigationParameterGenerator(Generator):

def generate(self):
for i in range(1, self.amount):
generate_investigation_parameter(i)
InvestigationParameterGenerator.generate_investigation_parameter(i)


def generate_investigation_parameter(i):
# TODO - Why's this not in the class?
investigation_parameter = models.INVESTIGATIONPARAMETER()
apply_common_attributes(investigation_parameter, i)
apply_common_parameter_attributes(investigation_parameter, i)
investigation_parameter.investigationID = i
investigation_parameter.parameterTypeID = faker.random_int(
1, ParameterTypeGenerator.amount - 1,
)
post_entity(investigation_parameter)
@staticmethod
def generate_investigation_parameter(i):
investigation_parameter = models.INVESTIGATIONPARAMETER()
apply_common_attributes(investigation_parameter, i)
apply_common_parameter_attributes(investigation_parameter, i)
investigation_parameter.investigationID = i
investigation_parameter.parameterTypeID = faker.random_int(
1, ParameterTypeGenerator.amount - 1,
)
post_entity(investigation_parameter)


class ShiftGenerator(Generator):
Expand Down

0 comments on commit f211b44

Please sign in to comment.