Beispiel #1
0
 def test_read_positive(self):
     """Test positive."""
     info = VariableInfo('table_type', 'var')
     info.read_json({'positive': self.value}, '')
     self.assertEqual(info.positive, self.value)
Beispiel #2
0
 def test_read_default_frequency(self):
     """Test positive."""
     info = VariableInfo('table_type', 'var')
     info.read_json({}, self.value)
     self.assertEqual(info.frequency, self.value)
Beispiel #3
0
 def test_read_units(self):
     """Test units."""
     info = VariableInfo('table_type', 'var')
     info.read_json({'units': self.value}, '')
     self.assertEqual(info.units, self.value)
Beispiel #4
0
 def test_read_valid_max(self):
     """Test valid_max."""
     info = VariableInfo('table_type', 'var')
     info.read_json({'valid_max': self.value}, '')
     self.assertEqual(info.valid_max, self.value)
Beispiel #5
0
 def test_read_long_name(self):
     """Test long_name."""
     info = VariableInfo('table_type', 'var')
     info.read_json({'long_name': self.value}, '')
     self.assertEqual(info.long_name, self.value)
Beispiel #6
0
 def test_read_standard_name(self):
     """Test standard_name."""
     info = VariableInfo('table_type', 'var')
     info.read_json({'standard_name': self.value}, '')
     self.assertEqual(info.standard_name, self.value)
Beispiel #7
0
 def test_read_empty_dictionary(self):
     """Test read empty dict."""
     info = VariableInfo('table_type', 'var')
     info.read_json({}, '')
     self.assertEqual('', info.standard_name)
Beispiel #8
0
 def test_constructor(self):
     """Test basic constructor."""
     info = VariableInfo('table_type', 'var')
     self.assertEqual('table_type', info.table_type)
     self.assertEqual('var', info.short_name)
Beispiel #9
0
 def test_read_valid_min(self):
     """Test valid_min."""
     info = VariableInfo('table_type', 'var')
     info.read_json({'valid_min': self.value})
     self.assertEqual(info.valid_min, self.value)