Exemplo n.º 1
0
    def test_set_api_configs(self):
        """Tests that the ``set_api_configs`` method properly (re)sets the API configs."""

        dev = HQSDevice(3, machine=DUMMY_MACHINE, user_email=DUMMY_EMAIL)
        new_user = "******"
        dev._user = new_user
        dev.BASE_HOSTNAME = "https://server.someaddress.com"
        dev.TARGET_PATH = "some/path"
        dev.set_api_configs()

        assert dev.hostname == "https://server.someaddress.com/some/path"
        assert dev._user == new_user
Exemplo n.º 2
0
    def test_set_api_configs(self):
        """Tests that the ``set_api_configs`` method properly (re)sets the API configs."""

        dev = HQSDevice(3, machine=DUMMY_MACHINE, api_key=SOME_API_KEY)
        new_api_key = "XYZ789"
        dev._api_key = new_api_key
        dev.BASE_HOSTNAME = "https://server.someaddress.com"
        dev.TARGET_PATH = "some/path"
        dev.set_api_configs()

        assert dev.header == {
            "x-api-key": new_api_key,
            "User-Agent": "pennylane-honeywell_v{}".format(__version__),
        }
        assert dev.hostname == "https://server.someaddress.com/some/path"