def setUp(self):
     self.host = '127.0.0.1'
     self.connection = connection(self.host, 800)
     self._time_and_locale = ApplianceTimeAndLocaleConfiguration(
         self.connection)
     self.uri = "/rest/appliance/configuration/time-locale"
     self._time_and_locale.data = {"uri": self.uri}
class ApplianceTimeAndLocaleConfigurationTest(unittest.TestCase):
    def setUp(self):
        self.host = '127.0.0.1'
        self.connection = connection(self.host, 800)
        self._time_and_locale = ApplianceTimeAndLocaleConfiguration(
            self.connection)
        self.uri = "/rest/appliance/configuration/time-locale"
        self._time_and_locale.data = {"uri": self.uri}

    @mock.patch.object(Resource, 'get_by_uri')
    def test_get_called_once(self, mock_get):
        self._time_and_locale.get_all()
        mock_get.assert_called_once_with(
            '/rest/appliance/configuration/time-locale')

    @mock.patch.object(Resource, 'create')
    def test_update_called_once(self, mock_create):
        resource = {
            'dateTime': '2020-02-27T7:55:00.000Z',
            'locale': 'en_US.UTF-8',
            'localeDisplayName': 'English (United States)',
            'ntpServers': ['127.0.0.1'],
            'timezone': 'UTC',
            'uri': None
        }
        self._time_and_locale.create(resource, timeout=-1)
        mock_create.assert_called_once_with(resource, timeout=-1)
예제 #3
0
    def appliance_time_and_locale_configuration(self):
        """
        Gets the ApplianceTimeAndLocaleConfiguration API client.

        Returns:
            ApplianceTimeAndLocaleConfiguration:
        """
        return ApplianceTimeAndLocaleConfiguration(self.__connection)
예제 #4
0
 def setUp(self):
     self.host = '127.0.0.1'
     self.connection = connection(self.host, 800)
     self._time_and_locale = ApplianceTimeAndLocaleConfiguration(
         self.connection)