-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8ab8cc
commit 0811468
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import pytest | ||
from collections import OrderedDict | ||
from astropy.table import Table | ||
from hermes_core.util.schema import HERMESDataSchema | ||
|
||
|
||
def test_hermes_data_schema(): | ||
schema = HERMESDataSchema() | ||
|
||
# Global Attribute Schema | ||
assert schema.global_attribute_schema is not None | ||
assert isinstance(schema.global_attribute_schema, dict) | ||
|
||
# Variable Attribute Schema | ||
assert schema.variable_attribute_schema is not None | ||
assert isinstance(schema.variable_attribute_schema, dict) | ||
|
||
# Default Globla Attributes | ||
assert schema.default_global_attributes is not None | ||
assert isinstance(schema.default_global_attributes, dict) | ||
|
||
# Global Attribute Template | ||
assert schema.global_attribute_template() is not None | ||
assert isinstance(schema.global_attribute_template(), OrderedDict) | ||
|
||
# Measurement Attribute Template | ||
assert schema.measurement_attribute_template() is not None | ||
assert isinstance(schema.measurement_attribute_template(), OrderedDict) | ||
|
||
# Global Attribute Info | ||
assert schema.global_attribute_info() is not None | ||
assert isinstance(schema.global_attribute_info(), Table) | ||
assert isinstance(schema.global_attribute_info(attribute_name="Descriptor"), Table) | ||
with pytest.raises(KeyError): | ||
_ = schema.global_attribute_info(attribute_name="NotAnAttribute") | ||
|
||
# Measurement Attribute Info | ||
assert schema.measurement_attribute_info() is not None | ||
assert isinstance(schema.measurement_attribute_info(), Table) | ||
assert isinstance( | ||
schema.measurement_attribute_info(attribute_name="CATDESC"), Table | ||
) | ||
with pytest.raises(KeyError): | ||
_ = schema.measurement_attribute_info(attribute_name="NotAnAttribute") |