Travis Shirk avatar Travis Shirk committed c0ebef1

Updated for removal of 'cli'

Comments (0)

Files changed (2)

src/test/test_main.py

 from eyed3.compat import StringIO
 from nose.tools import *
 from eyed3 import main, info
-from eyed3.utils import cli
 from eyed3.compat import PY2
 from . import RedirectStdStreams
 

src/test/test_utils.py

 ################################################################################
 import sys
 from nose.tools import *
-from eyed3.utils import guessMimetype, cli
-from eyed3.utils.cli import printMsg, printWarning, printHeader
+import eyed3.utils.console
+from eyed3.utils import guessMimetype
+from eyed3.utils.console import (printMsg, printWarning, printHeader, Fore,
+                                 WARNING_COLOR, HEADER_COLOR)
 from . import RedirectStdStreams
 
 
         assert_equal(mt, "application/x-id3")
 
 def test_printWarning():
-    cli.enableColorOutput(sys.stderr, False)
+    eyed3.utils.console.USE_ANSI = False
     with RedirectStdStreams() as out:
         printWarning("Built To Spill")
     assert_equal(out.stderr.read(), "Built To Spill\n")
 
+    eyed3.utils.console.USE_ANSI = True
+    with RedirectStdStreams() as out:
+        printWarning("Built To Spill")
+    assert_equal(out.stderr.read(), "%sBuilt To Spill%s\n" % (WARNING_COLOR(),
+                                                              Fore.RESET))
+
 def test_printMsg():
-    cli.enableColorOutput(sys.stdout, False)
+    eyed3.utils.console.USE_ANSI = False
+    with RedirectStdStreams() as out:
+        printMsg("EYEHATEGOD")
+    assert_equal(out.stdout.read(), "EYEHATEGOD\n")
+
+    eyed3.utils.console.USE_ANSI = True
     with RedirectStdStreams() as out:
         printMsg("EYEHATEGOD")
     assert_equal(out.stdout.read(), "EYEHATEGOD\n")
 
 def test_printHeader():
-    cli.enableColorOutput(sys.stdout, False)
+    eyed3.utils.console.USE_ANSI = False
     with RedirectStdStreams() as out:
         printHeader("Furthur")
     assert_equal(out.stdout.read(), "Furthur\n")
+
+    eyed3.utils.console.USE_ANSI = True
+    with RedirectStdStreams() as out:
+        printHeader("Furthur")
+    assert_equal(out.stdout.read(), "%sFurthur%s\n" % (HEADER_COLOR(),
+                                                       Fore.RESET))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.