예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)