docstr: Test buffer init
docstr_tok: ["Test","buffer","init"]
code: def test_init_default(self):
      """Test buffer init"""
      # No data
      B = Buffer()
      assert B.nbytes == 0
      glir_cmd = B._glir.clear()[-1]
      assert glir_cmd[0] == "CREATE"
  
      # With data
      data = np.zeros(100)
      B = Buffer(data=data)
      assert B.nbytes == data.nbytes
      glir_cmd = B._glir.clear()[-1]
      assert glir_cmd[0] == "DATA"
  
      # With nbytes
      B = Buffer(nbytes=100)
      assert B.nbytes == 100
      glir_cmd = B._glir.clear()[-1]
      assert glir_cmd[0] == "SIZE"
  
      # Wrong data
      self.assertRaises(ValueError, Buffer, data, 4)
      self.assertRaises(ValueError, Buffer, data, data.nbytes)
  
imports: import unittest
  import numpy
  from vispy.testing import run_tests_if_main
  from vispy.gloo.buffer import Buffer, DataBuffer, DataBufferView, VertexBuffer, IndexBuffer
label_desc: Use image node_id 1 for calling the BufferTest obj's underlying member method code with example usage: obj.test_init_default() without return types