mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 14:30:30 +03:00 
			
		
		
		
	Fix UTC timezone import to work on Python <3.11
This commit is contained in:
		
							parent
							
								
									9201b3ca94
								
							
						
					
					
						commit
						62b4af4f19
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -7,11 +7,11 @@ import subprocess
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
import threading
 | 
					import threading
 | 
				
			||||||
import unittest
 | 
					import unittest
 | 
				
			||||||
 | 
					from datetime import datetime, timezone
 | 
				
			||||||
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
 | 
					from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
 | 
				
			||||||
from pathlib import Path
 | 
					from pathlib import Path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import loguru
 | 
					import loguru
 | 
				
			||||||
from datetime import UTC, datetime
 | 
					 | 
				
			||||||
from androguard.core.apk import get_apkid
 | 
					from androguard.core.apk import get_apkid
 | 
				
			||||||
from ruamel.yaml import YAML
 | 
					from ruamel.yaml import YAML
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -740,7 +740,7 @@ class IntegrationTest(unittest.TestCase):
 | 
				
			||||||
        self.update_yaml("metadata/com.politedroid.yml", {"ArchivePolicy": 1})
 | 
					        self.update_yaml("metadata/com.politedroid.yml", {"ArchivePolicy": 1})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.assert_run(self.fdroid_cmd + ["update", "--pretty", "--nosign"])
 | 
					        self.assert_run(self.fdroid_cmd + ["update", "--pretty", "--nosign"])
 | 
				
			||||||
        timestamp = int(datetime(2017, 6, 23, tzinfo=UTC).timestamp()) * 1000
 | 
					        timestamp = int(datetime(2017, 6, 23, tzinfo=timezone.utc).timestamp()) * 1000
 | 
				
			||||||
        index_v1_json = Path("repo/index-v1.json").read_text()
 | 
					        index_v1_json = Path("repo/index-v1.json").read_text()
 | 
				
			||||||
        self.assertIn(f'"added": {timestamp}', index_v1_json)
 | 
					        self.assertIn(f'"added": {timestamp}', index_v1_json)
 | 
				
			||||||
        # the archive will have the added timestamp for the app and for the apk,
 | 
					        # the archive will have the added timestamp for the app and for the apk,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue