Exemplo n.º 1
0
    def test_setclockformat(self, gsettings_mock):
        '''
        Test for Set the clock format, either 12h or 24h format..
        '''
        with patch.object(gsettings_mock, '_set', return_value=True):
            self.assertTrue(gnomedesktop.setClockFormat('12h'))

        self.assertFalse(gnomedesktop.setClockFormat('a'))
Exemplo n.º 2
0
    def test_setclockformat(self, gsettings_mock):
        '''
        Test for Set the clock format, either 12h or 24h format..
        '''
        with patch.object(gsettings_mock, '_set', return_value=True):
            self.assertTrue(gnomedesktop.setClockFormat('12h'))

        self.assertFalse(gnomedesktop.setClockFormat('a'))
    def test_setclockformat(self):
        """
        Test for Set the clock format, either 12h or 24h format..
        """
        with patch("salt.modules.gnomedesktop._GSettings") as gsettings_mock:
            with patch.object(gsettings_mock, "_set", return_value=True):
                self.assertTrue(gnomedesktop.setClockFormat("12h"))

            self.assertFalse(gnomedesktop.setClockFormat("a"))