import nose
import swap_channels
import sound

def test_swap_channels():
  snd = sound.create_sound (3)
  for sample in snd:
    sound.set_left (sample, 50)

  swapped_snd = swap_channels.swap_channels(snd)
  
  for sample in swapped_snd:
    left = sound.get_left (sample)
    right = sound.get_right (sample)
    assert left == 0 and right == 50, \
           'sample not swapped correctly'
      
      
if __name__ == '__main__':
  nose.runmodule()
  