def test1(self):
        # delete temporary file before trying to write to it
        if os.path.exists(self.fn):
            os.remove(self.fn)

        block = neo.Block()
        full_range = 234 * pq.mV

        # Create segment1 with analogsignals
        segment1 = neo.Segment()
        sig1 = neo.AnalogSignal([3, 4, 5], units='mV', channel_index=3,
                                sampling_rate=30000.*pq.Hz)
        sig2 = neo.AnalogSignal([6, -4, -5], units='mV', channel_index=4,
                                sampling_rate=30000.*pq.Hz)
        segment1.analogsignals.append(sig1)
        segment1.analogsignals.append(sig2)

        # Create segment2 with analogsignals
        segment2 = neo.Segment()
        sig3 = neo.AnalogSignal([-3, -4, -5], units='mV', channel_index=3,
                                sampling_rate=30000.*pq.Hz)
        sig4 = neo.AnalogSignal([-6, 4, 5], units='mV', channel_index=4,
                                sampling_rate=30000.*pq.Hz)
        segment2.analogsignals.append(sig3)
        segment2.analogsignals.append(sig4)

        # Link segments to block
        block.segments.append(segment1)
        block.segments.append(segment2)

        # Create hardware view, and bijectivity
        #tools.populate_RecordingChannel(block)
        #print "problem happening"
        #print block.recordingchannelgroups[0].recordingchannels
        #chan = block.recordingchannelgroups[0].recordingchannels[0]
        #print chan.analogsignals
        #block.create_many_to_one_relationship()
        #print "here: "
        #print block.segments[0].analogsignals[0].recordingchannel

        # Chris I prefer that:
        #tools.finalize_block(block)
        tools.populate_RecordingChannel(block)
        block.create_many_to_one_relationship()

        # Check that blackrockio is correctly extracting channel indexes
        self.assertEqual(neo.io.blackrockio_deprecated.channel_indexes_in_segment(
            segment1), [3, 4])
        self.assertEqual(neo.io.blackrockio_deprecated.channel_indexes_in_segment(
            segment2), [3, 4])

        # Create writer. Write block, then read back in.
        bio = neo.io.blackrockio_deprecated.BlackrockIO(filename=self.fn, full_range=full_range)
        bio.write_block(block)
        fi = file(self.fn)

        # Text header
        self.assertEqual(fi.read(16), 'NEURALSG30 kS/s\x00')
        self.assertEqual(fi.read(8), '\x00\x00\x00\x00\x00\x00\x00\x00')

        # Integers: period, channel count, channel index1, channel index2
        self.assertEqual(struct.unpack('<4I', fi.read(16)), (1, 2, 3, 4))

        # What should the signals be after conversion?
        conv = float(full_range) / 2**16
        sigs = np.array([np.concatenate((sig1, sig3)),
                         np.concatenate((sig2, sig4))])
        sigs_converted = np.rint(sigs / conv).astype(np.int)

        # Check that each time point is the same
        for time_slc in sigs_converted.transpose():
            written_data = struct.unpack('<2h', fi.read(4))
            self.assertEqual(list(time_slc), list(written_data))

        # Check that we read to the end
        currentpos = fi.tell()
        fi.seek(0, 2)
        truelen = fi.tell()
        self.assertEqual(currentpos, truelen)
        fi.close()

        # Empty out test session again
        #~ delete_test_session()
:reference: https://dev.twitter.com/rest/reference/post/statuses/update_with_media
dataset/ETHPy150Open NeuralEnsemble/python-neo/neo/test/iotest/test_blackrockio_deprecated.py/testWrite.test1--crossover with--dataset/ETHPy150Open tweepy/tweepy/tweepy/api.py/API.update_with_media