def test_write_file(): """To ensure write_file has correct output""" contents = 'yay' path = 'testfile.txt' madlib.write_file(path, contents) with open(path) as f: assert f.read() == contents
def test_writing(): """checking if write_file is working """ contents = 'sample' path = './foo.txt' madlib.write_file(path, contents) with open(path) as f: assert f.read() == contents
def test_write_file(): contents = 'f' path = './foo.txt' madlib.write_file(path, contents) with open(path) as f: assert f.read() == contents
def test_write_file(): """Test whether write_file works properly.""" madlib.write_file('./foo.txt', 'foo') with open('./foo.txt') as f: assert f.read() == 'foo'
def test_write_file(): write_file(test_file, 'test') with open(test_file) as f: assert f.read() == 'test'