Skip to content

Commit

Permalink
Remove duplicate test in integration/test_machine
Browse files Browse the repository at this point in the history
... already exists in integration/test_unit
  • Loading branch information
cderici committed Jan 10, 2024
1 parent e0df1cb commit 2f7c236
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions tests/integration/test_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Licensed under the Apache V2, see LICENCE file for details.

import asyncio
from tempfile import NamedTemporaryFile

import pytest

Expand Down Expand Up @@ -37,31 +36,3 @@ async def test_status():
machine.status_message.lower() == 'running' and
machine.agent_status == 'started')),
timeout=480)


@base.bootstrapped
async def test_scp():
# ensure that asyncio.subprocess will work;
try:
asyncio.get_child_watcher().attach_loop()
except RuntimeError:
pytest.skip('test_scp will always fail outside of MainThread')
async with base.CleanModel() as model:
await model.add_machine()
await asyncio.wait_for(
model.block_until(lambda: model.machines),
timeout=240)
machine = model.machines['0']
await asyncio.wait_for(
model.block_until(lambda: (machine.status == 'running' and
machine.agent_status == 'started')),
timeout=480)

with NamedTemporaryFile() as f:
f.write(b'testcontents')
f.flush()
await machine.scp_to(f.name, 'testfile', scp_opts='-p')

with NamedTemporaryFile() as f:
await machine.scp_from('testfile', f.name, scp_opts='-p')
assert f.read() == b'testcontents'

0 comments on commit 2f7c236

Please sign in to comment.