from nose.tools import *
from kumquat.kumquat import Kumquat

def setup():
    pass

def teardown():
    pass

def test_kumquat():
    """Kumquat Test"""
    url = "https://lafent.github.io"
    k = Kumquat(url)

    assert k != None

def test_kumquat_initial_url():
    """Kumquat test of url setting"""
    url = "https://lafent.github.io"

    k = Kumquat(url)
    kurl = "%s" % (k.initial_url,)

    assert kurl == url

def test_kumquat_str():
    """Kumquat to string representation test"""
    url = "http://lafent.github.io"
    result = "k: %s: %s" % (url, False)

    k = Kumquat(url)
    k.initial_url = url

    kstr = "%s" % (k,)

    assert kstr == result

def test_kumquat_butler():
    """Kumquat to string representation test"""
    url = "http://lafent.github.io"

    k = Kumquat(url)
    b = k.butler

    assert b != None
    assert b.resource == url
    assert b.has_fetched == False
    assert k.is_parsed == False
