mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-19 17:25:56 +02:00
formatted for code readability
This commit is contained in:
parent
aa0a398c06
commit
38f7ef50db
3 changed files with 14 additions and 9 deletions
|
@ -1,4 +1,3 @@
|
|||
import glob
|
||||
import logging
|
||||
import math
|
||||
import os
|
||||
|
@ -92,7 +91,7 @@ class Command(BaseCommand):
|
|||
|
||||
logger.info(f"Successfully exported {table_name} into {num_files} files.")
|
||||
|
||||
except AttributeError as ae:
|
||||
except AttributeError:
|
||||
logger.error(f"Resource class {resourcename} not found in registrar.admin")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to export {table_name}: {e}")
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import argparse
|
||||
import glob
|
||||
import logging
|
||||
import os
|
||||
import pyzipper
|
||||
|
@ -75,7 +74,6 @@ class Command(BaseCommand):
|
|||
|
||||
# Define the directory and the pattern for csv filenames
|
||||
tmp_dir = "tmp"
|
||||
#pattern = os.path.join(tmp_dir, f"{table_name}_*.csv")
|
||||
pattern = f"{table_name}_"
|
||||
|
||||
resourceclass = getattr(registrar.admin, resourcename)
|
||||
|
|
|
@ -870,8 +870,6 @@ class TestCleanTables(TestCase):
|
|||
self.logger_mock.error.assert_any_call("Error cleaning table DomainInformation: Some error")
|
||||
|
||||
|
||||
|
||||
|
||||
class TestExportTables(MockEppLib):
|
||||
"""Test the export_tables script"""
|
||||
|
||||
|
@ -902,8 +900,18 @@ class TestExportTables(MockEppLib):
|
|||
|
||||
# Check that the export_table function was called for each table
|
||||
table_names = [
|
||||
"User", "Contact", "Domain", "DomainRequest", "DomainInformation", "FederalAgency",
|
||||
"UserDomainRole", "DraftDomain", "Website", "HostIp", "Host", "PublicContact",
|
||||
"User",
|
||||
"Contact",
|
||||
"Domain",
|
||||
"DomainRequest",
|
||||
"DomainInformation",
|
||||
"FederalAgency",
|
||||
"UserDomainRole",
|
||||
"DraftDomain",
|
||||
"Website",
|
||||
"HostIp",
|
||||
"Host",
|
||||
"PublicContact",
|
||||
]
|
||||
|
||||
# Mock directory listing
|
||||
|
@ -1025,7 +1033,7 @@ class TestImportTables(TestCase):
|
|||
"Host",
|
||||
"PublicContact",
|
||||
]
|
||||
|
||||
|
||||
# Mock directory listing
|
||||
mock_listdir.side_effect = lambda path: [f"{table}_1.csv" for table in table_names]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue