2017-02-21 17:46:31 +01:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
from grep import grep
|
|
|
|
|
|
2018-11-05 16:05:18 +01:00
|
|
|
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
2019-12-19 15:44:53 -03:00
|
|
|
import builtins
|
2017-04-04 14:01:56 +02:00
|
|
|
|
2019-12-19 15:44:53 -03:00
|
|
|
FILE_TEXT = {
|
|
|
|
|
"iliad.txt": """Achilles sing, O Goddess! Peleus' son;
|
2017-02-21 17:46:31 +01:00
|
|
|
His wrath pernicious, who ten thousand woes
|
|
|
|
|
Caused to Achaia's host, sent many a soul
|
|
|
|
|
Illustrious into Ades premature,
|
|
|
|
|
And Heroes gave (so stood the will of Jove)
|
|
|
|
|
To dogs and to all ravening fowls a prey,
|
|
|
|
|
When fierce dispute had separated once
|
|
|
|
|
The noble Chief Achilles from the son
|
2019-12-19 15:44:53 -03:00
|
|
|
Of Atreus, Agamemnon, King of men.""",
|
|
|
|
|
"midsummer-night.txt": """I do entreat your grace to pardon me.
|
2017-02-21 17:46:31 +01:00
|
|
|
I know not by what power I am made bold,
|
|
|
|
|
Nor how it may concern my modesty,
|
|
|
|
|
In such a presence here to plead my thoughts;
|
|
|
|
|
But I beseech your grace that I may know
|
|
|
|
|
The worst that may befall me in this case,
|
2019-12-19 15:44:53 -03:00
|
|
|
If I refuse to wed Demetrius.""",
|
|
|
|
|
"paradise-lost.txt": """Of Mans First Disobedience, and the Fruit
|
2017-02-21 17:46:31 +01:00
|
|
|
Of that Forbidden Tree, whose mortal tast
|
|
|
|
|
Brought Death into the World, and all our woe,
|
|
|
|
|
With loss of Eden, till one greater Man
|
|
|
|
|
Restore us, and regain the blissful Seat,
|
|
|
|
|
Sing Heav'nly Muse, that on the secret top
|
|
|
|
|
Of Oreb, or of Sinai, didst inspire
|
2019-12-19 15:44:53 -03:00
|
|
|
That Shepherd, who first taught the chosen Seed""",
|
|
|
|
|
}
|
2018-01-20 04:05:24 -06:00
|
|
|
FILES = {}
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
|
2019-11-07 08:58:16 -05:00
|
|
|
class File:
|
2019-12-19 15:44:53 -03:00
|
|
|
def __init__(self, name=""):
|
2018-01-20 04:05:24 -06:00
|
|
|
self.name = name
|
2019-12-19 15:44:53 -03:00
|
|
|
self.contents = ""
|
2018-01-20 04:05:24 -06:00
|
|
|
|
|
|
|
|
def read(self):
|
|
|
|
|
return self.contents
|
|
|
|
|
|
|
|
|
|
def readlines(self):
|
2019-12-19 15:44:53 -03:00
|
|
|
return [line + "\n" for line in self.read().split("\n") if line]
|
2018-01-20 04:05:24 -06:00
|
|
|
|
|
|
|
|
def write(self, data):
|
|
|
|
|
self.contents += data
|
|
|
|
|
|
|
|
|
|
def __enter__(self):
|
|
|
|
|
return self
|
|
|
|
|
|
|
|
|
|
def __exit__(self, *args):
|
2017-02-21 17:46:31 +01:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
2018-01-20 04:05:24 -06:00
|
|
|
# Store builtin definition of open()
|
|
|
|
|
builtins.oldopen = builtins.open
|
|
|
|
|
|
|
|
|
|
|
2019-12-19 15:44:53 -03:00
|
|
|
def open(name, mode="r", *args, **kwargs):
|
2018-01-20 04:05:24 -06:00
|
|
|
# if name is a mocked file name, lookup corresponding mocked file
|
2019-12-19 15:44:53 -03:00
|
|
|
if name in FILE_TEXT:
|
|
|
|
|
if mode == "w" or name not in FILES:
|
2018-01-20 04:05:24 -06:00
|
|
|
FILES[name] = File(name)
|
|
|
|
|
return FILES[name]
|
|
|
|
|
# else call builtin open()
|
|
|
|
|
else:
|
|
|
|
|
return builtins.oldopen(name, mode, *args, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# remove mocked file contents
|
|
|
|
|
def remove_file(file_name):
|
|
|
|
|
del FILES[file_name]
|
|
|
|
|
|
|
|
|
|
|
2017-02-21 17:46:31 +01:00
|
|
|
def create_file(name, contents):
|
2019-12-19 15:44:53 -03:00
|
|
|
with open(name, "w") as f:
|
2017-02-21 17:46:31 +01:00
|
|
|
f.write(contents)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GrepTest(unittest.TestCase):
|
|
|
|
|
@classmethod
|
2019-12-19 15:44:53 -03:00
|
|
|
def setUpClass(cls):
|
2018-01-20 04:05:24 -06:00
|
|
|
# Override builtin open() with mock-file-enabled one
|
|
|
|
|
builtins.open = open
|
2019-12-19 15:44:53 -03:00
|
|
|
for name, text in FILE_TEXT.items():
|
|
|
|
|
create_file(name, text)
|
|
|
|
|
cls.maxDiff = None
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
@classmethod
|
2019-12-19 15:44:53 -03:00
|
|
|
def tearDownClass(cls):
|
|
|
|
|
for name in FILE_TEXT:
|
|
|
|
|
remove_file(name)
|
2018-01-20 04:05:24 -06:00
|
|
|
# Restore builtin open()
|
|
|
|
|
builtins.open = builtins.oldopen
|
2017-02-21 17:46:31 +01:00
|
|
|
|
2019-12-19 15:44:53 -03:00
|
|
|
# Test grepping a single file
|
2017-02-21 17:46:31 +01:00
|
|
|
def test_one_file_one_match_no_flags(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("Agamemnon", "", ["iliad.txt"]), "Of Atreus, Agamemnon, King of men.\n"
|
2018-01-20 04:05:24 -06:00
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_one_file_one_match_print_line_numbers_flag(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("Forbidden", "-n", ["paradise-lost.txt"]),
|
|
|
|
|
"2:Of that Forbidden Tree, whose mortal tast\n",
|
2018-01-20 04:05:24 -06:00
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_one_file_one_match_case_insensitive_flag(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("FORBIDDEN", "-i", ["paradise-lost.txt"]),
|
|
|
|
|
"Of that Forbidden Tree, whose mortal tast\n",
|
2018-01-20 04:05:24 -06:00
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_one_file_one_match_print_file_names_flag(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("Forbidden", "-l", ["paradise-lost.txt"]), "paradise-lost.txt\n"
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_one_file_one_match_match_entire_lines_flag(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep(
|
|
|
|
|
"With loss of Eden, till one greater Man", "-x", ["paradise-lost.txt"]
|
|
|
|
|
),
|
|
|
|
|
"With loss of Eden, till one greater Man\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_one_file_one_match_multiple_flags(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("OF ATREUS, Agamemnon, KIng of MEN.", "-n -i -x", ["iliad.txt"]),
|
|
|
|
|
"9:Of Atreus, Agamemnon, King of men.\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_one_file_several_matches_no_flags(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("may", "", ["midsummer-night.txt"]),
|
2018-01-20 04:05:24 -06:00
|
|
|
"Nor how it may concern my modesty,\n"
|
|
|
|
|
"But I beseech your grace that I may know\n"
|
2019-12-19 15:44:53 -03:00
|
|
|
"The worst that may befall me in this case,\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_one_file_several_matches_print_line_numbers_flag(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("may", "-n", ["midsummer-night.txt"]),
|
2018-01-20 04:05:24 -06:00
|
|
|
"3:Nor how it may concern my modesty,\n"
|
|
|
|
|
"5:But I beseech your grace that I may know\n"
|
2019-12-19 15:44:53 -03:00
|
|
|
"6:The worst that may befall me in this case,\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_one_file_several_matches_match_entire_lines_flag(self):
|
2019-12-19 15:44:53 -03:00
|
|
|
self.assertMultiLineEqual(grep("may", "-x", ["midsummer-night.txt"]), "")
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_one_file_several_matches_case_insensitive_flag(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("ACHILLES", "-i", ["iliad.txt"]),
|
2018-01-20 04:05:24 -06:00
|
|
|
"Achilles sing, O Goddess! Peleus' son;\n"
|
2019-12-19 15:44:53 -03:00
|
|
|
"The noble Chief Achilles from the son\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_one_file_several_matches_inverted_flag(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("Of", "-v", ["paradise-lost.txt"]),
|
2018-01-20 04:05:24 -06:00
|
|
|
"Brought Death into the World, and all our woe,\n"
|
|
|
|
|
"With loss of Eden, till one greater Man\n"
|
|
|
|
|
"Restore us, and regain the blissful Seat,\n"
|
|
|
|
|
"Sing Heav'nly Muse, that on the secret top\n"
|
2019-12-19 15:44:53 -03:00
|
|
|
"That Shepherd, who first taught the chosen Seed\n",
|
|
|
|
|
)
|
2018-11-05 16:05:18 +01:00
|
|
|
|
2017-02-21 17:46:31 +01:00
|
|
|
def test_one_file_no_matches_various_flags(self):
|
2019-12-19 15:44:53 -03:00
|
|
|
self.assertMultiLineEqual(grep("Gandalf", "-n -l -x -i", ["iliad.txt"]), "")
|
|
|
|
|
|
|
|
|
|
def test_one_file_one_match_file_flag_takes_precedence_over_line_flag(self):
|
|
|
|
|
self.assertMultiLineEqual(grep("ten", "-n -l", ["iliad.txt"]), "iliad.txt\n")
|
|
|
|
|
|
|
|
|
|
def test_one_file_several_matches_inverted_and_match_entire_lines_flags(self):
|
2017-02-21 17:46:31 +01:00
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("Illustrious into Ades premature,", "-x -v", ["iliad.txt"]),
|
|
|
|
|
"Achilles sing, O Goddess! Peleus' son;\n"
|
|
|
|
|
"His wrath pernicious, who ten thousand woes\n"
|
|
|
|
|
"Caused to Achaia's host, sent many a soul\n"
|
|
|
|
|
"And Heroes gave (so stood the will of Jove)\n"
|
|
|
|
|
"To dogs and to all ravening fowls a prey,\n"
|
|
|
|
|
"When fierce dispute had separated once\n"
|
|
|
|
|
"The noble Chief Achilles from the son\n"
|
|
|
|
|
"Of Atreus, Agamemnon, King of men.\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
2019-12-19 15:44:53 -03:00
|
|
|
# Test grepping multiples files at once
|
2017-02-21 17:46:31 +01:00
|
|
|
def test_multiple_files_one_match_no_flags(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep(
|
|
|
|
|
"Agamemnon",
|
|
|
|
|
"",
|
|
|
|
|
["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
|
|
|
),
|
|
|
|
|
"iliad.txt:Of Atreus, Agamemnon, King of men.\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_multiple_files_several_matches_no_flags(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("may", "", ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]),
|
2018-01-20 04:05:24 -06:00
|
|
|
"midsummer-night.txt:Nor how it may concern my modesty,\n"
|
|
|
|
|
"midsummer-night.txt:But I beseech your grace that I may know\n"
|
2019-12-19 15:44:53 -03:00
|
|
|
"midsummer-night.txt:The worst that may befall me in this case,\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_multiple_files_several_matches_print_line_numbers_flag(self):
|
2019-12-19 15:44:53 -03:00
|
|
|
self.assertMultiLineEqual(
|
|
|
|
|
grep(
|
|
|
|
|
"that", "-n", ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
|
|
|
|
|
),
|
2018-01-20 04:05:24 -06:00
|
|
|
"midsummer-night.txt:5:But I beseech your grace that I may know\n"
|
2019-12-19 15:44:53 -03:00
|
|
|
"midsummer-night.txt:6:The worst that may befall me in this case,\n"
|
|
|
|
|
"paradise-lost.txt:2:Of that Forbidden Tree, whose mortal tast\n"
|
|
|
|
|
"paradise-lost.txt:6:Sing Heav'nly Muse, that on the secret top\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_multiple_files_one_match_print_file_names_flag(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep(
|
|
|
|
|
"who", "-l", ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]
|
|
|
|
|
),
|
|
|
|
|
"iliad.txt\n" "paradise-lost.txt\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_multiple_files_several_matches_case_insensitive_flag(self):
|
2019-12-19 15:44:53 -03:00
|
|
|
self.assertMultiLineEqual(
|
|
|
|
|
grep("TO", "-i", ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]),
|
2018-01-20 04:05:24 -06:00
|
|
|
"iliad.txt:Caused to Achaia's host, sent many a soul\n"
|
|
|
|
|
"iliad.txt:Illustrious into Ades premature,\n"
|
|
|
|
|
"iliad.txt:And Heroes gave (so stood the will of Jove)\n"
|
|
|
|
|
"iliad.txt:To dogs and to all ravening fowls a prey,\n"
|
|
|
|
|
"midsummer-night.txt:I do entreat your grace to pardon me.\n"
|
2019-12-19 15:44:53 -03:00
|
|
|
"midsummer-night.txt:In such a presence here to plead my thoughts;\n"
|
|
|
|
|
"midsummer-night.txt:If I refuse to wed Demetrius.\n"
|
|
|
|
|
"paradise-lost.txt:Brought Death into the World, and all our woe,\n"
|
|
|
|
|
"paradise-lost.txt:Restore us, and regain the blissful Seat,\n"
|
|
|
|
|
"paradise-lost.txt:Sing Heav'nly Muse, that on the secret top\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_multiple_files_several_matches_inverted_flag(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep("a", "-v", ["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"]),
|
2018-01-20 04:05:24 -06:00
|
|
|
"iliad.txt:Achilles sing, O Goddess! Peleus' son;\n"
|
|
|
|
|
"iliad.txt:The noble Chief Achilles from the son\n"
|
2019-12-19 15:44:53 -03:00
|
|
|
"midsummer-night.txt:If I refuse to wed Demetrius.\n",
|
2018-01-20 04:05:24 -06:00
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_multiple_files_one_match_match_entire_lines_flag(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep(
|
|
|
|
|
"But I beseech your grace that I may know",
|
|
|
|
|
"-x",
|
|
|
|
|
["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
|
|
|
),
|
|
|
|
|
"midsummer-night.txt:But I beseech your grace that I may know\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_multiple_files_one_match_multiple_flags(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep(
|
|
|
|
|
"WITH LOSS OF EDEN, TILL ONE GREATER MAN",
|
|
|
|
|
"-n -i -x",
|
|
|
|
|
["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
|
|
|
),
|
|
|
|
|
"paradise-lost.txt:4:With loss of Eden, till one greater Man\n",
|
|
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
|
|
|
|
def test_multiple_files_no_matches_various_flags(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep(
|
|
|
|
|
"Frodo",
|
|
|
|
|
"-n -l -x -i",
|
|
|
|
|
["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
|
|
|
),
|
|
|
|
|
"",
|
2018-01-20 04:05:24 -06:00
|
|
|
)
|
2017-02-21 17:46:31 +01:00
|
|
|
|
2019-12-19 15:44:53 -03:00
|
|
|
def test_multiple_files_several_matches_file_flag_takes_precedence_over_line_number_flag(
|
|
|
|
|
self
|
|
|
|
|
):
|
2018-11-05 16:05:18 +01:00
|
|
|
self.assertMultiLineEqual(
|
2019-12-19 15:44:53 -03:00
|
|
|
grep(
|
|
|
|
|
"who",
|
|
|
|
|
"-n -l",
|
|
|
|
|
["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
|
|
|
),
|
|
|
|
|
"iliad.txt\n" "paradise-lost.txt\n",
|
|
|
|
|
)
|
2018-11-05 16:05:18 +01:00
|
|
|
|
2019-12-19 15:44:53 -03:00
|
|
|
def test_multiple_files_several_matches_inverted_and_match_entire_lines_flags(self):
|
|
|
|
|
self.assertMultiLineEqual(
|
|
|
|
|
grep(
|
|
|
|
|
"Illustrious into Ades premature,",
|
|
|
|
|
"-x -v",
|
|
|
|
|
["iliad.txt", "midsummer-night.txt", "paradise-lost.txt"],
|
|
|
|
|
),
|
2018-11-05 16:05:18 +01:00
|
|
|
"iliad.txt:Achilles sing, O Goddess! Peleus' son;\n"
|
|
|
|
|
"iliad.txt:His wrath pernicious, who ten thousand woes\n"
|
|
|
|
|
"iliad.txt:Caused to Achaia's host, sent many a soul\n"
|
|
|
|
|
"iliad.txt:And Heroes gave (so stood the will of Jove)\n"
|
|
|
|
|
"iliad.txt:To dogs and to all ravening fowls a prey,\n"
|
|
|
|
|
"iliad.txt:When fierce dispute had separated once\n"
|
|
|
|
|
"iliad.txt:The noble Chief Achilles from the son\n"
|
|
|
|
|
"iliad.txt:Of Atreus, Agamemnon, King of men.\n"
|
|
|
|
|
"midsummer-night.txt:I do entreat your grace to pardon me.\n"
|
|
|
|
|
"midsummer-night.txt:I know not by what power I am made bold,\n"
|
|
|
|
|
"midsummer-night.txt:Nor how it may concern my modesty,\n"
|
2019-12-19 15:44:53 -03:00
|
|
|
"midsummer-night.txt:In such a presence here to plead my thoughts;\n"
|
|
|
|
|
"midsummer-night.txt:But I beseech your grace that I may know\n"
|
2018-11-05 16:05:18 +01:00
|
|
|
"midsummer-night.txt:The worst that may befall me in this case,\n"
|
|
|
|
|
"midsummer-night.txt:If I refuse to wed Demetrius.\n"
|
|
|
|
|
"paradise-lost.txt:Of Mans First Disobedience, and the Fruit\n"
|
|
|
|
|
"paradise-lost.txt:Of that Forbidden Tree, whose mortal tast\n"
|
2019-12-19 15:44:53 -03:00
|
|
|
"paradise-lost.txt:Brought Death into the World, and all our woe,\n"
|
|
|
|
|
"paradise-lost.txt:With loss of Eden, till one greater Man\n"
|
2018-11-05 16:05:18 +01:00
|
|
|
"paradise-lost.txt:Restore us, and regain the blissful Seat,\n"
|
|
|
|
|
"paradise-lost.txt:Sing Heav'nly Muse, that on the secret top\n"
|
|
|
|
|
"paradise-lost.txt:Of Oreb, or of Sinai, didst inspire\n"
|
2019-12-19 15:44:53 -03:00
|
|
|
"paradise-lost.txt:That Shepherd, who first taught the chosen Seed\n",
|
2018-11-05 16:05:18 +01:00
|
|
|
)
|
|
|
|
|
|
2017-02-21 17:46:31 +01:00
|
|
|
|
2019-12-19 15:44:53 -03:00
|
|
|
if __name__ == "__main__":
|
2017-02-21 17:46:31 +01:00
|
|
|
unittest.main()
|