Example #1
0
def test_pop_curl():
    url = 'https://compciv.github.io/stash/hi.txt'
    dp = Pop('curl', '-s', '-A', "'webkitfoo'", url)
    assert dp.statement() == """curl -s -A 'webkitfoo' {}""".format(url)

    dp.run()
    assert dp.text == 'hi'
Example #2
0
def test_run_pop():
    _foo = 'echo'
    _parms = 'hello'
    pt = Pop('echo', 'hello')
    pt.run()

    assert pt.has_run() is True
    assert pt.command == 'echo'
    assert pt.params == ('hello', )
    assert pt.text.strip() == 'hello'
    assert pt.content.strip() == b'hello'
Example #3
0
def test_pop_name():
    pt = Pop('pdfwhatever')
    assert type(pt) == Pop
    assert pt.name == 'pdfwhatever'
    assert pt.command == pt.name
Example #4
0
def test_non_run_pop_to_dict():
    dp = Pop('whatev').to_dict()
    assert dp['name'] == 'whatev'
    assert dp['has_run'] == False
    assert dp['text'] == None
    assert dp['params'] == tuple()
Example #5
0
def test_pop_metaargs():
    pt = Pop('wat')
    args = pt._makeargs()
    assert type(args) is tuple
Example #6
0
def test_dead_pop():
    pt = Pop('dead')
    assert type(pt.params) is tuple
    assert not pt.has_run()
Example #7
0
def test_statement():
    pt = Pop('pdffoo', 'x', 'y')
    assert pt.statement() == 'pdffoo x y'
Example #8
0
def test_destructure():
    pt = Pop('x', 'y')
    assert type(pt.params) is tuple
    assert type(pt._makeargs()) is tuple