Exemplo n.º 1
0
 def test_get_end_time(self):
     """Test that a valid dim_configs is accepted."""
     self.config.dims["time"].update({"index_by": "time"})
     a = InputFileNode(self.config, another_input_file)
     end_found = num2date(
         a.get_last_of_index_by(self.config.dims["time"]),
         "seconds since 2000-01-01 12:00:00",
     )
     self.assertEqual(end_found, datetime(2017, 4, 14, 20, 28, 59, 800611))
Exemplo n.º 2
0
 def test_get_end_time(self):
     self.config.dims["report_number"].update({
         "index_by": "OB_time",
         "other_dim_inds": {
             "number_samples_per_report": 0
         }
     })
     a = InputFileNode(self.config, test_input_file)
     end_found = num2date(
         a.get_last_of_index_by(self.config.dims["report_number"]),
         "seconds since 2000-01-01 12:00:00",
     )
     self.assertEqual(end_found, datetime(2017, 2, 12, 15, 0, 58, 900926))
Exemplo n.º 3
0
 def test_get_start_time_with_cadence(self):
     self.config.dims["report_number"].update({
         "index_by": "OB_time",
         "other_dim_inds": {
             "number_samples_per_report": 0
         },
         "expected_cadence": {
             "report_number": 1,
             "number_samples_per_report": 10,
         },
     })
     a = InputFileNode(self.config, test_input_file)
     start_found = num2date(
         a.get_first_of_index_by(self.config.dims["report_number"]),
         "seconds since 2000-01-01 12:00:00",
     )
     self.assertEqual(start_found, datetime(2017, 2, 12, 14, 59, 59,
                                            900905))
Exemplo n.º 4
0
 def test_instantiation_with_config(self):
     """Test that a valid dim_configs is accepted."""
     self.config.dims["report_number"].update({
         "index_by": "OB_time",
         "other_dim_inds": {
             "number_samples_per_report": 0
         }
     })
     InputFileNode(self.config, test_input_file)
Exemplo n.º 5
0
 def test_instantiation_basic(self):
     """Test that the most basic instantiation works."""
     InputFileNode(self.config, test_input_file)
Exemplo n.º 6
0
 def test_instantiation_with_config(self):
     """Test that a valid dim_configs is accepted."""
     self.config.dims["time"].update({"index_by": "time"})
     InputFileNode(self.config, another_input_file)