def load(self): file_validate = file_validator.FileValidator(new_file=self.file) if file_validate.check(): self.read_file() self.data_parser() self.get_details() else: print("Incorrect File")
def do_check(self, file): """check {file} Check file is valid """ if file: fvalid = file_validator.FileValidator(file) if fvalid.check(): self.view.say("File is Valid for extracting") else: self.view.say("File is incorrect format or " "may not be PlantUML") else: self.view.say("File not specified a file")
def doc_test1(n): """ >>> doc_test1("READ.txt") True >>> doc_test1("Rel.txt") True >>> doc_test1("test1.txt") File Does not Exist >>> doc_test1("View.py") False >>> doc_test1("READ.doc") File Does not Exist """ i = file_validator.FileValidator(n) return i.check_plant()
def doc_test2(n): """ >>> doc_test1("READ.txt") True >>> doc_test1("Rel.txt") True >>> doc_test1("test1.txt") File Does not Exist >>> doc_test1("READ.pdf") File Does not Exist >>> doc_test1("View.py") False """ i = file_validator.FileValidator(n) return i.file_extension_check()
def test_file_extension_check1(self): arrange = "some.txt" self.assertTrue( file_validator.FileValidator(arrange).file_extension_check())
def test_plant3(self): input_file = "view.py" i = file_validator.FileValidator(input_file) self.assertFalse(i.file_extension_check())
def test_plant2(self): input_file = "Rel.txt" i = file_validator.FileValidator(input_file) self.assertTrue(i.file_extension_check())
def test_file_extension_check2(self): arrange = "some.doc" self.assertFalse( file_validator.FileValidator(arrange).file_extension_check())