Remove superfluous calls to Python subprocess.
authorBen Finney <redacted>
Sat, 7 Apr 2018 04:52:57 +0000 (14:52 +1000)
committerBen Finney <redacted>
Sat, 7 Apr 2018 04:52:57 +0000 (14:52 +1000)
tests/test_xkcdpass.py

index 340383c0987721b013d5bec4c119221da082380e..cc71f394685041d76964dc41c554a78b08523db6 100644 (file)
@@ -3,7 +3,6 @@
 import argparse
 import io
 import re
-import subprocess
 import sys
 import unittest
 import unittest.mock
@@ -37,15 +36,6 @@ class XkcdPasswordTests(unittest.TestCase):
             acrostic=word)
         self.assertEqual("".join(map(lambda x: x[0], result.split())), word)
 
-    def test_commandlineCount(self):
-        count = 6
-        result = subprocess.check_output([
-            sys.executable, "xkcdpass/xkcd_password.py",
-            "-w", WORDFILE,
-            "-c", str(count),
-        ])
-        self.assertTrue(result.count(b"\n"), count)
-
     def test_delim(self):
         tdelim = "_"
         result = xkcd_password.generate_xkcdpassword(
@@ -53,24 +43,6 @@ class XkcdPasswordTests(unittest.TestCase):
             delimiter=tdelim)
         self.assertIsNotNone(re.match('([a-z]+(_|$))+', result))
 
-    def test_separator(self):
-        count = 3
-        result = subprocess.check_output(
-            ["python", "xkcdpass/xkcd_password.py",
-             "--count", str(count),
-             "--delimiter", "|",
-             "--separator", " "])
-        self.assertEqual(result.count(b" "), 3)
-
-    def test_separator_no_end(self):
-        "Pipe output to other program. e.g. `xkcdpass -c 1 -s "" | xsel -b`"
-        count = 1
-        result = subprocess.check_output(
-            ["python", "xkcdpass/xkcd_password.py",
-             "--count", str(count),
-             "--separator", ""])
-        self.assertEqual(result.find(b"\n"), -1)
-
     def test_set_case(self):
         words = "this is only a test".lower().split()
         words_before = set(words)
git clone https://git.99rst.org/PROJECT