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