Exemple #1
0
 def test_missing_tuple_with_default_tuple(self):
     self.assertEqual(envar('TOWEL', tuple, '("forty","two")'), ('forty', 'two'))
Exemple #2
0
 def test_missing_tuple_with_default_tuple_without_parens(self):
     self.assertEqual(envar('TOWEL', tuple, '"forty","two"'), ('forty', 'two'))
Exemple #3
0
 def test_missing_str_with_default_str(self):
     self.assertEqual(envar('TOWEL', str, 'here'), 'here')
Exemple #4
0
 def test_missing_bool_with_default_bool(self):
     self.assertEqual(envar('TOWEL', bool, 'True'), True)
Exemple #5
0
 def test_missing_int_with_default_int(self):
     self.assertEqual(envar('TOWEL', int, '42'), 42)
Exemple #6
0
 def test_env_var_available_with_default_verbose(self):
     os.environ['LEWOT'] = '42'
     self.assertEqual(envar('LEWOT', int, '24', verbose=True), 42)
Exemple #7
0
 def test_env_var_available_with_no_default(self):
     os.environ['LEWOT'] = '42'
     self.assertEqual(envar('LEWOT', int), 42)