X-Git-Url: https://code.communitydata.science/mediawiki_dump_tools.git/blobdiff_plain/7cd0bf3b9ed2f0dba9a864ce1f3c6d9207d70035..c84844cfb58f343e6632f1a6c57f702bd96c616d:/test/Wikiq_Unit_Test.py diff --git a/test/Wikiq_Unit_Test.py b/test/Wikiq_Unit_Test.py index 91ac928..9011d79 100644 --- a/test/Wikiq_Unit_Test.py +++ b/test/Wikiq_Unit_Test.py @@ -69,10 +69,33 @@ class Test_Wikipedia(unittest.TestCase): # as a test let's make sure that we get equal data frames test = pd.read_table(test_file) num_wrong_ns = sum(~ test.namespace.isin({0,1})) - self.assertEquals(num_wrong_ns, 0) + self.assertEqual(num_wrong_ns, 0) baseline = pd.read_table(baseline_file) assert_frame_equal(test,baseline) + def test_WP_revert_radius(self): + print(os.path.abspath('.')) + test_filename = "revert_radius_" + self.wikiq_out_name + test_file = os.path.join(self.test_output_dir, test_filename) + if os.path.exists(test_file): + os.remove(test_file) + + call = self.base_call.format(self.input_file, self.test_output_dir) + call = call + " -n 0 -n 1 -rr 1" + print(call) + proc = subprocess.Popen(call,stdout=subprocess.PIPE,shell=True) + proc.wait() + copyfile(self.call_output, test_file) + baseline_file = os.path.join(os.path.abspath("."), self.baseline_output_dir, test_filename) + + # as a test let's make sure that we get equal data frames + test = pd.read_table(test_file) + num_wrong_ns = sum(~ test.namespace.isin({0,1})) + self.assertEqual(num_wrong_ns, 0) + baseline = pd.read_table(baseline_file) + assert_frame_equal(test,baseline) + + class Test_Basic(unittest.TestCase):