Example #1
0
 def test_zone_compare(self):
     '''
     Test if it checks the md5sum between the given timezone, and
     the one set in /etc/localtime. Returns True if they match,
     and False if not. Mostly useful for running state checks.
     '''
     mock_cmd = MagicMock(return_value='India Standard Time')
     with patch.dict(win_timezone.__salt__, {'cmd.run': mock_cmd}):
         self.assertTrue(win_timezone.zone_compare('Asia/Calcutta'))
Example #2
0
 def test_zone_compare(self):
     '''
     Test if it checks the md5sum between the given timezone, and
     the one set in /etc/localtime. Returns True if they match,
     and False if not. Mostly useful for running state checks.
     '''
     mock_cmd = MagicMock(return_value='India Standard Time')
     with patch.dict(win_timezone.__salt__, {'cmd.run': mock_cmd}):
         self.assertTrue(win_timezone.zone_compare('Asia/Calcutta'))
Example #3
0
    def test_zone_compare(self):
        """
        Test if it checks the md5sum between the given timezone, and
        the one set in /etc/localtime. Returns True if they match,
        and False if not. Mostly useful for running state checks.
        """
        mock_read = MagicMock(return_value={"vdata": "India Standard Time"})

        with patch.dict(win_timezone.__utils__, {"reg.read_value": mock_read}):
            self.assertTrue(win_timezone.zone_compare("Asia/Calcutta"))
Example #4
0
    def test_zone_compare(self):
        """
        Test if it checks the md5sum between the given timezone, and
        the one set in /etc/localtime. Returns True if they match,
        and False if not. Mostly useful for running state checks.
        """
        mock_read = MagicMock(
            return_value={
                "pid": 78,
                "retcode": 0,
                "stderr": "",
                "stdout": "India Standard Time",
            })

        with patch.dict(win_timezone.__salt__, {"cmd.run_all": mock_read}):
            self.assertTrue(win_timezone.zone_compare("Asia/Calcutta"))