def test_noauth_submit(mocker):
    'Submit a file and ensure that the same file is unpacked.'
    with mocks.Server() as server:
        client = assemblyline_client.get_client(server.address, verify=False)
        submits = server.submits
        client.submit(path='readme.txt', contents=b'abc123')
        assert (len(submits) == 1)
        assert (b64decode(submits[0]['binary']) == b'abc123')
        assert (submits[0]['name'] == 'readme.txt')
        submits.pop()
        mocker.patch('os.path.exists', return_value=True)
        mocker.patch('assemblyline_client.v3_client.open', mock.mock_open(read_data=b'abc123'), create=True)
        client.submit(path='readme.txt')
        assert (len(submits) == 1)
        assert (b64decode(submits[0]['binary']) == b'abc123')
        assert (submits[0]['name'] == 'readme.txt')
        submits.pop()
Submit a file and ensure that the same file is unpacked.
def test_noauth_submit(mocker):
    
    with mocks.Server() as server:
        client = assemblyline_client.get_client(server.address, verify=False)
        submits = server.submits
        client.submit(path='readme.txt', contents=b'abc123')
        assert (len(submits) == 1)
        assert (b64decode(submits[0]['binary']) == b'abc123')
        assert (submits[0]['name'] == 'readme.txt')
        submits.pop()
        mocker.patch('os.path.exists', return_value=True)
        mocker.patch('assemblyline_client.v3_client.open', mock.mock_open(read_data=b'abc123'), create=True)
        client.submit(path='readme.txt')
        assert (len(submits) == 1)
        assert (b64decode(submits[0]['binary']) == b'abc123')
        assert (submits[0]['name'] == 'readme.txt')
        submits.pop()