def test_cat2(self): self.filename = "v2.txt" file = open(self.filename, "w") content = "" file.write(content) file.close() self.assertEqual("", solution.cat(self.filename)) os.remove(self.filename)
def test_cat1(self): self.filename = "v1.txt" file = open(self.filename, "w") content = "Hello, I am a test file" file.write(content) file.close() self.assertEqual("Hello, I am a test file", solution.cat(self.filename)) os.remove(self.filename)
def test_cat(self): self.assertEqual(self.content, solution.cat())
def test_cat(self): self.assertEqual("tests", solution.cat(self.filename))
def test_cat_helper(self): self.assertEqual( "There is more than one file or no arguments.", cat([])) self.assertEqual("Some content.", cat(['cat', 'test_file'])) self.assertEqual(self.content, cat(['cat', 'file.txt']))
def test_cat_command(self): self.file.write("Test some text") self.file.close() self.assertEqual("Test some text",cat(self.name))
def test_cat_contents(self): self.assertEqual("you should see this", cat(self.filename))
def test_cat(self): self.assertEqual("Hi my name is Dayana!", cat('filename.txt'))
def test_with_text_file(self): self.assertEqual(solution.cat('text_file.txt'), self.text)
def test_cat_command(self): self.file.write("Test some text") self.file.close() self.assertEqual("Test some text", cat(self.name))
def test_cat(self): result = cat("test_file") self.assertEqual("just a simple text for testing", result)