| 
									
										
										
										
											2015-11-05 02:22:02 +01:00
										 |  |  | from freezegun import freeze_time | 
					
						
							| 
									
										
										
										
											2018-01-20 19:44:22 -08:00
										 |  |  | import sure  # noqa | 
					
						
							| 
									
										
										
										
											2015-11-05 02:22:02 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-02 14:02:37 -05:00
										 |  |  | from moto.swf.models import Timeout | 
					
						
							| 
									
										
										
										
											2015-11-05 02:22:02 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | from ..utils import make_workflow_execution | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-02 14:02:37 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-11-05 02:22:02 +01:00
										 |  |  | def test_timeout_creation(): | 
					
						
							|  |  |  |     wfe = make_workflow_execution() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # epoch 1420113600 == "2015-01-01 13:00:00" | 
					
						
							|  |  |  |     timeout = Timeout(wfe, 1420117200, "START_TO_CLOSE") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     with freeze_time("2015-01-01 12:00:00"): | 
					
						
							|  |  |  |         timeout.reached.should.be.falsy | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     with freeze_time("2015-01-01 13:00:00"): | 
					
						
							|  |  |  |         timeout.reached.should.be.truthy |