def test_are_lists_equal(self): self.assertTrue(p.are_lists_equal([], [])) self.assertFalse(p.are_lists_equal([], [1])) self.assertRaises(ValueError, p.are_lists_equal, "", []) self.assertTrue(p.are_lists_equal([[]], [])) self.assertTrue(p.are_lists_equal([[2]], [2])) self.assertTrue(p.are_lists_equal(["Test"], ["Test"]))
def test_write_to_text_file(self): # Test file was created output_path = self._write_test_contents_to_cur_dir(p.InputFileType.text) self.assertTrue(os.path.exists(output_path)) file_contents = p.get_file_contents(output_path) # Check the contents of written file is same as the one defined in this class p.are_lists_equal(file_contents, self._test_file_contents)
def _test_clean_file(self, full_input_path, check_against, *options): output_path = p.clean_file(full_input_path, True, options) self.assertTrue(os.path.exists(output_path)) clean_content = p.get_file_contents(output_path) p.are_lists_equal(clean_content, check_against)