Skip to content

Commit

Permalink
tests: improve coverage for the tests without remote access
Browse files Browse the repository at this point in the history
  • Loading branch information
ManonMarchand committed Mar 27, 2024
1 parent 4c2c436 commit befe1c5
Show file tree
Hide file tree
Showing 10 changed files with 1,013 additions and 143 deletions.
9 changes: 5 additions & 4 deletions astroquery/simbad/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ class SimbadClass(BaseVOQuery):
SIMBAD_URL = 'https://' + conf.server + '/simbad/sim-script'
ROW_LIMIT = conf.row_limit

@dataclass
@dataclass(frozen=True)
class Column:
"""A class to define a column in a SIMBAD query."""
table: str
name: str
alias: str = field(default=None)

@dataclass
@dataclass(frozen=True)
class Join:
"""A class to define a join between two tables."""
table: str
Expand Down Expand Up @@ -199,11 +199,12 @@ def list_output_options(self):
velocity ...
"""
# get the tables with a simple link to basic
query_tables = """SELECT table_name AS name, tables.description
query_tables = """SELECT DISTINCT table_name AS name, tables.description
FROM TAP_SCHEMA.keys JOIN TAP_SCHEMA.key_columns USING (key_id)
JOIN TAP_SCHEMA.tables ON TAP_SCHEMA.keys.from_table = TAP_SCHEMA.tables.table_name
OR TAP_SCHEMA.keys.target_table = TAP_SCHEMA.tables.table_name
WHERE TAP_SCHEMA.tables.schema_name = 'public'
AND target_table = 'basic'
AND (from_table = 'basic' OR target_table = 'basic')
AND from_table != 'h_link'
"""
tables = self.query_tap(query_tables)
Expand Down
4 changes: 3 additions & 1 deletion astroquery/simbad/setup_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@


def get_package_data():
paths_test = [str(Path('data') / 'simbad_output_options.xml')]
paths_test = [str(Path('data') / 'simbad_output_options.xml'),
str(Path("data") / "simbad_basic_columns.xml"),
str(Path("data") / "simbad_linked_to_basic.xml")]

paths_core = [str(Path('data') / 'query_criteria_fields.json')]

Expand Down
Loading

0 comments on commit befe1c5

Please sign in to comment.