Exemple #1
0
def test_pprint(capfd, tweets):
    dispatcher.dispatch(args='pprint -s twitter://sample -v'.split(),
                        scriptname='poultry')

    out, err = capfd.readouterr()
    assert not err

    expected_result = u'\n'.join(pformat(json.loads(t)) for t in tweets) + '\n'
    assert out == expected_result
Exemple #2
0
def test_select(capfd, tweets):
    dispatcher.dispatch(args='select -s twitter://sample -v'.split(),
                        scriptname='poultry')

    out, err = capfd.readouterr()
    assert not err

    expected_result = u'\n'.join(tweets) + '\n'
    assert out == expected_result
Exemple #3
0
def test_timeline(capfd, tweets):
    dispatcher.dispatch(args='timeline -s twitter://sample -v'.split(),
                        scriptname='poultry')

    out, err = capfd.readouterr()
    assert not err

    assert out == (u'2012-04-13-13 1\n'
                   u'2012-04-26-07 1\n'
                   u'2012-05-12-09 1\n')
Exemple #4
0
def test_pprint(capfd, tweets, poultry_cfg):
    dispatcher.dispatch(
        args='pprint -s twitter://sample -v -c {}'.format(poultry_cfg).split(),
        scriptname='poultry',
    )

    out, err = capfd.readouterr()
    assert not err

    expected_result = u'\n'.join(pformat(json.loads(t)) for t in tweets) + '\n'
    assert out == expected_result
Exemple #5
0
def test_timeline(capfd, tweets, poultry_cfg):
    dispatcher.dispatch(
        args='timeline -s twitter://sample -v -c {}'.format(poultry_cfg).split(),
        scriptname='poultry',
    )

    out, err = capfd.readouterr()
    assert not err

    assert out == (
        u'2012-04-13-13 1\n'
        u'2012-04-26-07 1\n'
        u'2012-05-12-09 1\n'
    )
Exemple #6
0
def test_show(capfd):
    dispatcher.dispatch(args='show -s twitter://sample -v'.split(),
                        scriptname='poultry')

    out, err = capfd.readouterr()
    assert not err

    assert out == (
        u'dimazest: pinkpop pukkelpop paaspop prilpop pedropicopop all use #pp12 :)\n'
        u'https://twitter.com/#!/dimazest/status/190800262909276162\n'
        u'2012-04-13 13:55:02\n'
        u'\n'
        u'dimazest: #pygrunn here i come!\n'
        u'https://twitter.com/#!/dimazest/status/195415832510201856\n'
        u'2012-04-26 07:35:39\n'
        u'\n'
        u'dimazest: that\'s fun \u201c@gorban: http://t.co/rsjGQjCB\u201d\n'
        u'https://twitter.com/#!/dimazest/status/201239221502099456\n'
        u'2012-05-12 09:15:43\n\n')
Exemple #7
0
def test_show(capfd, poultry_cfg):
    dispatcher.dispatch(
        args='show -s twitter://sample -v -c {}'.format(poultry_cfg).split(),
        scriptname='poultry',
    )

    out, err = capfd.readouterr()
    assert not err

    assert out == (
        u'dimazest: pinkpop pukkelpop paaspop prilpop pedropicopop all use #pp12 :)\n'
        u'https://twitter.com/#!/dimazest/status/190800262909276162\n'
        u'2012-04-13 13:55:02\n'
        u'\n'
        u'dimazest: #pygrunn here i come!\n'
        u'https://twitter.com/#!/dimazest/status/195415832510201856\n'
        u'2012-04-26 07:35:39\n'
        u'\n'
        u'dimazest: that\'s fun \u201c@gorban: http://t.co/rsjGQjCB\u201d\n'
        u'https://twitter.com/#!/dimazest/status/201239221502099456\n'
        u'2012-05-12 09:15:43\n\n'
    )