from __future__ import print_function
import sys
sys.path.append('./')
import time
import pytest
from spinner.spinner import make_spin, BOX1, Spinner


class TestClass(object):
    def test_make_spin(self):
        @make_spin(BOX1, "Download youtube video")
        def demo():
            time.sleep(5)

        print("Downloading a youtube video, it would cost much time.")
        demo()

    def test_Spinner(self):
        spin = Spinner(BOX1)
        assert spin.current() == u'⠋'
        spin.next()
        assert spin.position == 1
        spin.reset()
        assert spin.position == 0

@@ -1,12 +1,30 @@
+# encoding: utf-8%0A
 from __futur
@@ -162,16 +162,69 @@
 pinner%0A%0A
+try:%0A    SPINSTR = unicode%0Aexcept:%0A    SPINSTR = str%0A
 %0Aclass T
@@ -524,24 +524,32 @@
      assert 
+SPINSTR(
 spin.current
@@ -550,16 +550,17 @@
 urrent()
+)
  == u'%E2%A0%8B'

fix py2 and py3 compilation