| 
									
										
										
										
											2018-12-21 12:28:56 +01:00
										 |  |  | from freezegun import freeze_time | 
					
						
							| 
									
										
										
										
											2021-10-18 19:44:29 +00:00
										 |  |  | import sure  # noqa # pylint: disable=unused-import | 
					
						
							| 
									
										
										
										
											2018-12-21 12:28:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | from moto.swf.models import Timeout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | from ..utils import make_workflow_execution | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 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"): | 
					
						
							| 
									
										
										
										
											2022-04-18 20:44:56 +00:00
										 |  |  |         timeout.reached.should.equal(False) | 
					
						
							| 
									
										
										
										
											2018-12-21 12:28:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     with freeze_time("2015-01-01 13:00:00"): | 
					
						
							| 
									
										
										
										
											2022-04-18 20:44:56 +00:00
										 |  |  |         timeout.reached.should.equal(True) |