コード例 #1
0
ファイル: test_test.py プロジェクト: arizvisa/saltstack-salt
    def test_fail_without_changes(self):
        """
            Test to returns failure.
        """
        ret = {"name": "salt", "changes": {}, "result": False, "comment": ""}
        with patch.dict(test.__opts__, {"test": False}):
            ret.update({"comment": "Failure!"})
            self.assertDictEqual(test.fail_without_changes("salt"), ret)

        with patch.dict(test.__opts__, {"test": False}):
            ret.update({"comment": "A failure comment!"})
            self.assertDictEqual(
                test.fail_without_changes("salt",
                                          comment="A failure comment!"), ret)
コード例 #2
0
ファイル: test_test.py プロジェクト: mjura/salt-1
 def test_fail_without_changes(self):
     '''
         Test to returns failure.
     '''
     ret = {'name': 'salt', 'changes': {}, 'result': False, 'comment': ''}
     with patch.dict(test.__opts__, {"test": False}):
         ret.update({'comment': 'Failure!'})
         self.assertDictEqual(test.fail_without_changes('salt'), ret)
コード例 #3
0
ファイル: test_test.py プロジェクト: paususe/salt-saltstack
def test_fail_without_changes():
    """
    Test to returns failure.
    """
    ret = {"name": "salt", "changes": {}, "result": False, "comment": ""}
    with patch.dict(test.__opts__, {"test": False}):
        ret.update({"comment": "Failure!"})
        assert test.fail_without_changes("salt") == ret

    with patch.dict(test.__opts__, {"test": False}):
        ret.update({"comment": "A failure comment!"})
        assert test.fail_without_changes("salt",
                                         comment="A failure comment!") == ret

    with patch.dict(test.__opts__, {"test": True}):
        ret.update(
            {"comment": "If we weren't testing, this would be a failure!"})
        assert test.fail_without_changes("salt") == ret
コード例 #4
0
ファイル: test_test.py プロジェクト: DaveQB/salt
 def test_fail_without_changes(self):
     '''
         Test to returns failure.
     '''
     ret = {'name': 'salt',
            'changes': {},
            'result': False,
            'comment': ''}
     with patch.dict(test.__opts__, {"test": False}):
         ret.update({'comment': 'Failure!'})
         self.assertDictEqual(test.fail_without_changes('salt'), ret)