Exemplo n.º 1
0
    def test_attach_iso(self, servers_client, server, generic_action):
        servers_client._client.request.return_value = generic_action
        action = servers_client.attach_iso(server, Iso(name="FreeBSD-11.0-RELEASE-amd64-dvd1"))
        servers_client._client.request.assert_called_with(url="/servers/1/actions/attach_iso", method="POST", json={"iso": "FreeBSD-11.0-RELEASE-amd64-dvd1"})

        assert action.id == 1
        assert action.progress == 0
Exemplo n.º 2
0
 def test_deprecated_is_datetime(self):
     iso = Iso(id=1, deprecated="2016-01-30T23:50+00:00")
     assert iso.deprecated == datetime.datetime(2016,
                                                1,
                                                30,
                                                23,
                                                50,
                                                tzinfo=tzoffset(None, 0))
Exemplo n.º 3
0
    def test_attach_iso(self, hetzner_client, server):
        action = hetzner_client.servers.attach_iso(
            server, Iso(name="FreeBSD-11.0-RELEASE-amd64-dvd1"))

        assert action.id == 13
        assert action.command == "attach_iso"
Exemplo n.º 4
0
    def test_attach_iso(self, bound_server):
        action = bound_server.attach_iso(
            Iso(name="FreeBSD-11.0-RELEASE-amd64-dvd1"))

        assert action.id == 13
        assert action.command == "attach_iso"