def test2a(self): expected_data = "Error:can\'t find file or read data" invalid_filename = "filedata1111.txt" # If I don't pass anything to constructor, then its default value will be stored f2 = File_test() # To change the existing instance value call this setFilename method and pass the reqd parameter f2.setFilename(invalid_filename) result = f2.file_validity_check() print result assert result == expected_data
def test1(self): valid_filename = "filedata.txt" f1 = File_test("A", valid_filename) f2 = File_test("B", valid_filename) print f1.name print f2.name print File_test.name result = f1.file_validity_check() File_test.static_test() print result assert result == 1
def test5(self): dirname = 66778 f5 = File_test(dirname) result = f5.file_validity_check() print "test5 result:", result
def test4(self): none_filename = None f4 = File_test(none_filename) result = f4.file_validity_check() print "test4 result:", result
def test3(self): empty_filename = "" f3 = File_test(empty_filename) result = f3.file_validity_check() print "test3 result:", result
def test2(self): expected_data = "Error:can\'t find file or read data" invalid_filename = "filedata1111.txt" f2 = File_test(invalid_filename) result = f2.file_validity_check() assert result == expected_data
def test1(self): valid_filename = "filedata.txt" f1 = File_test(valid_filename) result = f1.file_validity_check() print result assert result == 1