コード例 #1
0
ファイル: test_regendoc.py プロジェクト: yunstanford/devpi
def test_actions_of(tmpdir, example):

    actions = list(actions_of(example))

    interesting = [a_c_t(x) for x in actions]
    expected = [('write', 'test_simplefactory.py'),
                ('shell', 'py.test test_simplefactory.py')]

    assert interesting == expected
コード例 #2
0
ファイル: test_regendoc.py プロジェクト: kenatbasis/devpi
def test_actions_of(tmpdir, example):

    actions = list(actions_of(example))

    interesting = [a_c_t(x) for x in actions]
    expected = [
        ('write', 'test_simplefactory.py'),
        ('shell', 'py.test test_simplefactory.py')]

    assert interesting == expected
コード例 #3
0
ファイル: test_regendoc.py プロジェクト: yunstanford/devpi
def test_docfile_chdir(tmpdir):

    tmpdir.ensure('nested/file').write('some text\n')
    example = tmpdir.join('example.txt')
    example.write('some shell test\n'
                  '  nested $ cat file\n'
                  '  some other text\n')

    action, = list(actions_of(example))
    excpected_action = {
        'action': 'shell',
        'file': example,
        'content': 'some other text\n',
        'cwd': 'nested',
        'indent': 2,
        'line': 1,
        'target': 'cat file',
    }
    assert action == excpected_action

    needed_updates = check_file(example, tmpdir)
    pprint.pprint(needed_updates)
    assert needed_updates
コード例 #4
0
ファイル: test_regendoc.py プロジェクト: kenatbasis/devpi
def test_docfile_chdir(tmpdir):

    tmpdir.ensure('nested/file').write('some text\n')
    example = tmpdir.join('example.txt')
    example.write('some shell test\n'
                  '  nested $ cat file\n'
                  '  some other text\n')

    action, = list(actions_of(example))
    excpected_action = {
        'action': 'shell',
        'file': example,
        'content': 'some other text\n',
        'cwd': 'nested',
        'indent': 2,
        'line': 1,
        'target': 'cat file',
    }
    assert action == excpected_action

    needed_updates = check_file(example, tmpdir)
    py.std.pprint.pprint(needed_updates)
    assert needed_updates