# Path: bluechips/lib/helpers.py
# def redirect_to(*args, **kwargs):
# def currency(name, value, *args, **kwargs):
# def grab(obj, attr):


from unittest import TestCase
from pylons import request
from datetime import date
from bluechips.lib import helpers as h

class TestHelpers(TestCase):
    def test_grab_real_object(self):
        class Foo(object):
            pass
        foo = Foo()
        foo.bar = 'some string'
        assert h.grab(foo, 'bar') == 'some string'
        try:
            h.grab(foo, 'baz')
        except AttributeError:
            pass
        else:
            raise AssertionError

    def test_grab_any_fake(self):
        assert h.grab(None, 'nonexistent') == ''
        assert h.grab('', 'nonexistent') == ''

    def test_grab_date(self):

# Path: bluechips/lib/helpers.py
# def redirect_to(*args, **kwargs):
# def currency(name, value, *args, **kwargs):
# def grab(obj, attr):


# Path: bluechips/tests/lib/test_helpers.py
from unittest import TestCase
from pylons import request
from datetime import date
from bluechips.lib import helpers as h


class TestHelpers(TestCase):
    def test_grab_real_object(self):
        class Foo(object):
            pass
        foo = Foo()
        foo.bar = 'some string'
        assert h.grab(foo, 'bar') == 'some string'
        try:
            h.grab(foo, 'baz')
        except AttributeError:
            pass
        else:
            raise AssertionError

    def test_grab_any_fake(self):
        assert h.grab(None, 'nonexistent') == ''
        assert h.grab('', 'nonexistent') == ''

    def test_grab_date(self):

        assert h.grab(None, 'date') == date.today()