Beispiel #1
0
 def test_getgoal(self):
     '''
     Test if it returns goal(s) for a file or directory
     '''
     mock = MagicMock(return_value={'stdout': 'Salt: salt'})
     with patch.dict(moosefs.__salt__, {'cmd.run_all': mock}):
         self.assertDictEqual(moosefs.getgoal('/tmp/salt'), {'goal': 'salt'})
Beispiel #2
0
 def test_getgoal(self):
     '''
     Test if it returns goal(s) for a file or directory
     '''
     mock = MagicMock(return_value={'stdout': 'Salt: salt'})
     with patch.dict(moosefs.__salt__, {'cmd.run_all': mock}):
         self.assertDictEqual(moosefs.getgoal('/tmp/salt'), {'goal': 'salt'})
Beispiel #3
0
def test_getgoal():
    """
    Test if it returns goal(s) for a file or directory
    """
    mock = MagicMock(return_value={"stdout": "Salt: salt"})
    with patch.dict(moosefs.__salt__, {"cmd.run_all": mock}):
        assert moosefs.getgoal("/tmp/salt") == {"goal": "salt"}