Exemplo n.º 1
0
 def test_get_variable_empty_file(self):
     with self.assertRaises(check.FileFormatError) as ctx:
         check.get_variable({}, [], 'foo')
     self.assertEqual(str(ctx.exception), 'foo')
Exemplo n.º 2
0
 def test_get_variable_finds_in_file_with_whitespce(self):
     result = check.get_variable({}, ['foo = bar'], 'foo')
     self.assertEqual('bar', result)
Exemplo n.º 3
0
 def test_get_variable_prefers_env(self):
     result = check.get_variable({'foo': 'bar'}, ['foo=baz'], 'foo')
     self.assertEqual('bar', result)
Exemplo n.º 4
0
 def test_get_variable_empty_file(self):
     with self.assertRaises(check.FileFormatError) as ctx:
         check.get_variable({}, [], 'foo')
     self.assertEqual(str(ctx.exception), 'foo')
Exemplo n.º 5
0
 def test_get_variable_finds_in_file_with_whitespce(self):
     result = check.get_variable({}, ['foo = bar'], 'foo')
     self.assertEqual('bar', result)
Exemplo n.º 6
0
 def test_get_variable_prefers_env(self):
     result = check.get_variable({'foo': 'bar'}, ['foo=baz'], 'foo')
     self.assertEqual('bar', result)