Beispiel #1
0
 def test_vagrant_get_vm_info_not_found(self):
     mock_sdb = MagicMock(return_value=None)
     with patch.dict(vagrant.__utils__, {'sdb.sdb_get': mock_sdb}):
         with self.assertRaises(salt.exceptions.SaltInvocationError):
             vagrant.get_vm_info('thisNameDoesNotExist')
Beispiel #2
0
 def test_vagrant_get_vm_info(self):
     testdict = {'testone': 'one', 'machine': 'two'}
     mock_sdb = MagicMock(return_value=testdict)
     with patch.dict(vagrant.__utils__, {'sdb.sdb_get': mock_sdb}):
         resp = vagrant.get_vm_info('test1')
         self.assertEqual(resp, testdict)
Beispiel #3
0
 def test_vagrant_get_vm_info(self):
     testdict = {"testone": "one", "machine": "two"}
     mock_sdb = MagicMock(return_value=testdict)
     with patch.dict(vagrant.__utils__, {"sdb.sdb_get": mock_sdb}):
         resp = vagrant.get_vm_info("test1")
         self.assertEqual(resp, testdict)