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