File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ script:
1010- make test
1111after_success :
1212- coveralls
13+ after_failure :
14+ -
1315before_script :
1416- psql -f dbscripts/postgresql_account_create.sql -U postgres
1517- psql -f dbscripts/postgresql_process_tracker.sql process_tracking -U postgres
Original file line number Diff line number Diff line change 1414
1515class TestCli (unittest .TestCase ):
1616
17- def setUp (self ):
17+ @classmethod
18+ def setUpClass (cls ):
19+
20+ cls .data_store = DataStore ()
21+ cls .session = cls .data_store .session
1822
23+ def setUp (self ):
1924 self .runner = CliRunner ()
20- self .session = DataStore ().session
2125
2226 # def test_setup(self):
2327 #
@@ -145,12 +149,10 @@ def test_delete_actor(self):
145149 :return:
146150 """
147151 self .runner .invoke (process_tracker .cli .main , 'create -t actor -n "Test Test"' )
148- instance = self .session .query (Actor ).filter (Actor .actor_name == 'Test Test' ).first ()
149- print (instance .actor_name )
150152 result = self .runner .invoke (process_tracker .cli .main , 'delete -t actor -n "Test Test"' )
151153
152154 instance = self .session .query (Actor ).filter (Actor .actor_name == 'Test Test' ).first ()
153-
155+ print ( result . output )
154156 self .assertEqual (None , instance )
155157 self .assertEqual (0 , result .exit_code )
156158
Original file line number Diff line number Diff line change 11# Tests for validating process_tracking works as expected.
22
33from datetime import datetime , timedelta
4+ import time
45import unittest
56from unittest .mock import patch
67
@@ -261,6 +262,8 @@ def test_find_ready_extracts_by_process_not_descending(self):
261262 , location_name = 'Test Location'
262263 , location_path = '/home/test/extract_dir' )
263264
265+ time .sleep (3 )
266+
264267 extract2 = ExtractTracker (process_run = self .process_tracker
265268 , filename = 'test_extract_filename5-2.csv'
266269 , location_name = 'Test Location'
@@ -272,6 +275,7 @@ def test_find_ready_extracts_by_process_not_descending(self):
272275 session .commit ()
273276
274277 extract2 .extract .extract_status_id = extract2 .extract_status_ready
278+ extract2 .extract .extract_registration_date_time = datetime .now () # Records were being committed too close together.
275279 session = Session .object_session (extract2 .extract )
276280 session .commit ()
277281
You can’t perform that action at this time.
0 commit comments