Skip to content

Commit

Permalink
Updates to address warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmurphy1661 committed May 9, 2023
1 parent b41cfaa commit 631f413
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions activity_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Name change
#
# generate_range_check(n,a,b) - col between min / max (must be int)
# generate_date_range_check(n,a,b) - col between min / max (must be date)
# generate_date_range_check(n,a,b) - col between min / max (must be date ISO format)
# generate_required_check(n) - 0 len string
# generate_regex_check(n,regex_string) - any valid regex
# generate_regex_money_check(n) - money format
Expand Down Expand Up @@ -74,7 +74,7 @@ def _regex_check(n):
# False = no match
#
def generate_regex_money_check(n):
p = re.compile('/^-?\d+(,\d{3})*(\.\d{1,2})?$/')
p = re.compile("/^-{0,1}[0-9]+\\.{0,1}[0-9]{0,2}$/")
def _regex_money_check(n):
if p.match(n) == None:
return False
Expand Down
20 changes: 16 additions & 4 deletions data_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,25 @@ def filename(self):

def number_of_columns(self):
return self._number_of_columns

def flight_test(self,test_flights,config,findings):

#
# flight_test - apply the test_flights to the current data reader object (file to test)
# inputs:
# test_flights object
# config object
# findings object
#
def flight_test(self,test_flights,config,findings):
#
if config.stats_enabled:
print(f"stats on")
#
# open the file
#
with open(self.filename()) as f:
reader = csv.reader(f)
#
# skip the first row because it iss the header
# skip the first row because it is the header
#
next(reader)
line_counter = 0
Expand All @@ -57,7 +69,7 @@ def flight_test(self,test_flights,config,findings):
continue


# valid row structure
# we have a valid row structure
# apply tests to the appropriate columns
for flight in test_flights:

Expand Down
1 change: 1 addition & 0 deletions flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
def build_flight_list(column_list,config_options,findings):
flight_list = []
column_number = 0
working_flight = object
for working_option in config_options:
if "test" in working_option:
#
Expand Down

0 comments on commit 631f413

Please sign in to comment.