Beispiel #1
0
def test_machine() -> machine.Machine:
    """A test fixture that returns a Machine instance."""
    with tempfile.TemporaryDirectory(prefix="tmp_system_machines_") as d:
        yield machine.Machine.FromProto(
            machine_spec_pb2.MachineSpec(
                name="test",
                host=[
                    machine_spec_pb2.Host(host="localhost", port=22),
                ],
                mirrored_directory=[
                    machine_spec_pb2.MirroredDirectory(name="foo",
                                                       local_path=d,
                                                       remote_path="notused")
                ],
            ))
Beispiel #2
0
def test_host(test_machine: machine.Machine):
  """Test host attribute."""
  assert test_machine.host == machine_spec_pb2.Host(host='localhost', port=22)
def test_host() -> machine_spec_pb2.Host:
    return machine_spec_pb2.Host(host='localhost', port=22)