Skip to content

Commit

Permalink
Add test that verifies xtype is being set automatically for timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyMcCormick committed Nov 27, 2024
1 parent 2b579b2 commit ec52900
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_datamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ def default_coldata():
bool_coldata["value"] = True
Column(**bool_coldata)

def test_timestamp(self) -> None:
"""Test validation of timestamp columns."""
# Check that the votable_xtype is set correctly for timestamp columns.
col = Column(name="testColumn", id="#test_col_id", datatype="timestamp")
self.assertEqual(col.votable_xtype, "timestamp")


class TableTestCase(unittest.TestCase):
"""Test Pydantic validation of the ``Table`` class."""
Expand Down

0 comments on commit ec52900

Please sign in to comment.