Ejemplo n.º 1
0
 def test_not_found(self):
     with mock.patch('bfg9000.shell.which', mock_bad_which):
         self.assertEqual(version({}), None)
Ejemplo n.º 2
0
 def test_bad_execute(self):
     with mock.patch('bfg9000.shell.which', return_value=['command']), \
          mock.patch('bfg9000.shell.execute', mock_bad_execute):
         self.assertEqual(version({}), None)
Ejemplo n.º 3
0
 def test_good(self):
     with mock.patch('bfg9000.shell.which', return_value=['command']), \
          mock.patch('bfg9000.shell.execute', return_value='1.23'):
         self.assertEqual(version({}), Version('1.23'))