15954: Fix api pidfile race.
[arvados.git] / sdk / python / tests / test_arv_put.py
index d27ac9be070632b30bf34d7d87b6e500d476abed..a8c4a853cf9f35f94ab04a191bc0188de723f2ad 100644 (file)
@@ -852,27 +852,8 @@ class ArvadosPutTest(run_test_server.TestCaseWithServers,
 
 class ArvPutIntegrationTest(run_test_server.TestCaseWithServers,
                             ArvadosBaseTestCase):
-    def _getKeepServerConfig():
-        for config_file, mandatory in [
-                ['application.yml', False], ['application.default.yml', True]]:
-            path = os.path.join(run_test_server.SERVICES_SRC_DIR,
-                                "api", "config", config_file)
-            if not mandatory and not os.path.exists(path):
-                continue
-            with open(path) as f:
-                rails_config = yaml.safe_load(f.read())
-                for config_section in ['test', 'common']:
-                    try:
-                        key = rails_config[config_section]["blob_signing_key"]
-                    except (KeyError, TypeError):
-                        pass
-                    else:
-                        return {'blob_signing_key': key,
-                                'enforce_permissions': True}
-        return {'blog_signing_key': None, 'enforce_permissions': False}
-
     MAIN_SERVER = {}
-    KEEP_SERVER = _getKeepServerConfig()
+    KEEP_SERVER = {'blob_signing': True}
     PROJECT_UUID = run_test_server.fixture('groups')['aproject']['uuid']
 
     @classmethod
@@ -1198,11 +1179,15 @@ class ArvPutIntegrationTest(run_test_server.TestCaseWithServers,
             ['--no-progress', '--trash-at', trash_at, tmpdir])
         self.assertNotEqual(None, col['uuid'])
         c = arv_put.api_client.collections().get(uuid=col['uuid']).execute()
+        if time.daylight:
+            offset = datetime.timedelta(seconds=time.altzone)
+        else:
+            offset = datetime.timedelta(seconds=time.timezone)
         self.assertEqual(
-            ciso8601.parse_datetime(trash_at) + datetime.timedelta(seconds=time.timezone),
+            ciso8601.parse_datetime(trash_at) + offset,
             ciso8601.parse_datetime(c['trash_at']).replace(tzinfo=None))
 
-    def test_put_collection_with_timezone_expiring_date_only(self):
+    def test_put_collection_with_expiring_date_only(self):
         tmpdir = self.make_tmpdir()
         trash_at = '2140-01-01'
         end_of_day = datetime.timedelta(hours=23, minutes=59, seconds=59)
@@ -1213,8 +1198,12 @@ class ArvPutIntegrationTest(run_test_server.TestCaseWithServers,
             ['--no-progress', '--trash-at', trash_at, tmpdir])
         self.assertNotEqual(None, col['uuid'])
         c = arv_put.api_client.collections().get(uuid=col['uuid']).execute()
+        if time.daylight:
+            offset = datetime.timedelta(seconds=time.altzone)
+        else:
+            offset = datetime.timedelta(seconds=time.timezone)
         self.assertEqual(
-            ciso8601.parse_datetime(trash_at) + end_of_day + datetime.timedelta(seconds=time.timezone),
+            ciso8601.parse_datetime(trash_at) + end_of_day + offset,
             ciso8601.parse_datetime(c['trash_at']).replace(tzinfo=None))
 
     def test_put_collection_with_invalid_absolute_expiring_datetimes(self):