Ejemplo n.º 1
0
 def test_extra_sensors_with_extra_channels_and_mapping(self):
     """Test extra_sensors with extra_channels and mapping defined."""
     new_kwargs = METADATA_DEFAULTS
     new_kwargs["extra_channels"] = ["LDM_EP", "BDF_EP"]
     md = database.SeismicStationMetadata(**new_kwargs)
     md.extra_sensor_mapping = constant.DEFAULT_INFRASOUND_MAPPING
     assert md.extra_sensors == {"MEMS", "NCPA"}
Ejemplo n.º 2
0
    def test_is_decommissioned_at_null_endtime(self):
        """Test is_decommissioned_at with a null endtime."""

        t = 1265760000
        new_kwargs = METADATA_DEFAULTS.copy()
        new_kwargs["endtime"] = None
        md = database.SeismicStationMetadata(**new_kwargs)
        assert md.is_decommissioned_at(t) is False
        assert md.is_decommissioned_at(METADATA_TIME) is False
Ejemplo n.º 3
0
    def test_is_active_after_null_endtime(self):
        """Test is_active_after with null endtime."""
        # 1265760000.000 (041) 2010-02-10  00:00:00.00000 UTC Wednesday
        t = 1265760000

        new_kwargs = METADATA_DEFAULTS.copy()
        new_kwargs["endtime"] = None
        md = database.SeismicStationMetadata(**new_kwargs)
        assert md.is_active_after(t) is True
        assert md.is_active_after(METADATA_TIME) is True
        assert md.is_active_after(METADATA_TIME + 1) is True
        assert md.is_active_after(METADATA_TIME - 1) is True
Ejemplo n.º 4
0
    def test_is_active_before(self):
        """Test is_active_before."""

        # 1265760000.000 (041) 2010-02-10  00:00:00.00000 UTC Wednesday
        assert self.stametadata.is_active_before(1265760000) is False
        assert self.stametadata.is_active_before(METADATA_TIME) is False
        assert self.stametadata.is_active_before(METADATA_TIME - 1) is False

        new_kwargs = METADATA_DEFAULTS.copy()
        new_kwargs["endtime"] = None
        md = database.SeismicStationMetadata(**new_kwargs)
        assert md.is_active_before(1265760000) is True
        assert md.is_active_before(METADATA_TIME) is False
Ejemplo n.º 5
0
    def setUp(self):
        """Initialize a test metadata object."""

        self.stametadata = database.SeismicStationMetadata(**METADATA_DEFAULTS)