コード例 #1
0
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
コード例 #2
0
ファイル: test_madlib.py プロジェクト: MthwBrwn/madlib-cli
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
コード例 #3
0
def test_write_file():

    contents = 'f'

    path = './foo.txt'

    madlib.write_file(path, contents)

    with open(path) as f:
        assert f.read() == contents
コード例 #4
0
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'
コード例 #5
0
ファイル: test_madlib.py プロジェクト: 401-Python/madlib-cli
def test_write_file():
    write_file(test_file, 'test')
    with open(test_file) as f:
        assert f.read() == 'test'