from minifi import *
from minifi.test import *

def test_zero_file():
    """
    Verify sending data from a MiNiFi - C++ to NiFi using S2S protocol.
    """

    port = InputPort('from-minifi', RemoteProcessGroup('http://nifi:8080/nifi'))

    recv_flow = (port
                 >> LogAttribute()
                 >> PutFile('/tmp/output'))

    send_flow = (GenerateFlowFile('0B')
                 >> LogAttribute()
                 >> port)

    with DockerTestCluster(EmptyFilesOutPutValidator()) as cluster:
        cluster.deploy_flow(recv_flow, name='nifi', engine='nifi')
        cluster.deploy_flow(send_flow)
        assert cluster.check_output(60)
