Skip to content

Commit

Permalink
improve Integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
pnoll1 committed Jun 25, 2023
1 parent 3eaede4 commit b986387
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion osmand_osm/osm/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import psycopg2
import processing

logging.basicConfig(filename='processing_test_{0}.log'.format(datetime.datetime.today().isoformat()), level='DEBUG', format='%(asctime)s %(name)s %(levelname)s %(message)s')
time_current = datetime.datetime.today().isoformat()
log_filename = f'processing_test_{time_current}'
logging.basicConfig(filename=log_filename, level='DEBUG', format='%(asctime)s %(name)s %(levelname)s %(message)s')

# setup object to hold parser args
args = types.SimpleNamespace()
Expand Down Expand Up @@ -310,6 +312,7 @@ def setUp(self):

def tearDown(self):
run(['mv', '-f', 'config.bak', 'config.py'])
run(['mv', '../us_ri.osm.pbf', './us_ri_test.osm.pbf'])

def test_failure(self):
'''
Expand All @@ -322,6 +325,9 @@ def test_success(self):
'''
args.area_list = ['us:ri']
processing.main(args)
with open(log_filename) as log_file:
file_text = log_file.read()
self.assertNotRegex(file_text, 'ERROR')

class BuildTests(unittest.TestCase):
'''
Expand Down

0 comments on commit b986387

Please sign in to comment.