# Path: tsukiji/orderbook.py
# def create_ask(price, quantity, timeout):
# def create_bid(price, quantity, timeout):
# def create_trade(recipient, quantity, trade_id):
# def create_confirm(recipient, trade_id):
# def create_cancel(recipient, trade_id):
# def create_greeting():
# def create_greeting_response(peers):
# def create_msg(options=None):
# def trade_offer(their_offer, own_offer):
# def get_offer(id, message_id):
# def remove_offer(id, message_id):
# def clean_offers(f):
#     def func_wrapper(*args, **kwargs):
# def get_asks():
# def get_own_asks():
# def get_bids():
# def get_own_bids():
# def match_bid(bid):
# def match_incoming_bid(bid):
# def match_ask(ask):
# def match_incoming_ask(ask):
# def lowest_offer(offers):
# def highest_offer(offers):
# 
# Path: tsukiji/crypto.py
# def get_public_bytestring():
#     key = retrieve_key()
#     return key.publickey().exportKey()


from nose.tools import assert_equal, assert_is, assert_is_none, assert_is_not_none
from tsukiji import orderbook as ob
from tsukiji.crypto import get_public_bytestring
import unittest
import datetime
        import datetime
        their_ask = ob.create_ask(12, 1, next_year)
        their_ask['id'] = 1234
        matching_ask = ob.match_bid(own_bid)
        assert_is_none(matching_ask)

    def test_match_incoming_bid(self):
        own_ask = ob.create_ask(11, 1, next_year)
        their_bid = ob.create_bid(12, 1, next_year)
        their_bid['id'] = 1234
        matching_ask = ob.match_incoming_bid(their_bid)
        assert_is(matching_ask, own_ask)

    def test_match_incoming_bid_without_a_match(self):
        ob.create_ask(12, 1, next_year)
        their_bid = ob.create_bid(11, 1, next_year)
        their_bid['id'] = 1234
        matching_ask = ob.match_incoming_bid(their_bid)
        assert_is_none(matching_ask)

    def test_match_ask(self):
        own_ask = ob.create_ask(11, 1, next_year)
        their_bid = ob.create_bid(12, 1, next_year)
        their_bid['id'] = 1234
        matching_bid = ob.match_ask(own_ask)
        assert_is(matching_bid, their_bid)

    def test_match_ask_without_a_match(self):
        own_ask = ob.create_ask(11, 1, next_year)
        their_bid = ob.create_bid(10, 1, next_year)
        their_bid['id'] = 1234

# Path: tsukiji/orderbook.py
# def create_ask(price, quantity, timeout):
# def create_bid(price, quantity, timeout):
# def create_trade(recipient, quantity, trade_id):
# def create_confirm(recipient, trade_id):
# def create_cancel(recipient, trade_id):
# def create_greeting():
# def create_greeting_response(peers):
# def create_msg(options=None):
# def trade_offer(their_offer, own_offer):
# def get_offer(id, message_id):
# def remove_offer(id, message_id):
# def clean_offers(f):
#     def func_wrapper(*args, **kwargs):
# def get_asks():
# def get_own_asks():
# def get_bids():
# def get_own_bids():
# def match_bid(bid):
# def match_incoming_bid(bid):
# def match_ask(ask):
# def match_incoming_ask(ask):
# def lowest_offer(offers):
# def highest_offer(offers):
# 
# Path: tsukiji/crypto.py
# def get_public_bytestring():
#     key = retrieve_key()
#     return key.publickey().exportKey()


# Path: tests/test_orderbook.py
from nose.tools import assert_equal, assert_is, assert_is_none, assert_is_not_none
from tsukiji import orderbook as ob
from tsukiji.crypto import get_public_bytestring
import unittest
import datetime
        import datetime

        their_ask = ob.create_ask(12, 1, next_year)
        their_ask['id'] = 1234
        matching_ask = ob.match_bid(own_bid)
        assert_is_none(matching_ask)

    def test_match_incoming_bid(self):
        own_ask = ob.create_ask(11, 1, next_year)
        their_bid = ob.create_bid(12, 1, next_year)
        their_bid['id'] = 1234
        matching_ask = ob.match_incoming_bid(their_bid)
        assert_is(matching_ask, own_ask)

    def test_match_incoming_bid_without_a_match(self):
        ob.create_ask(12, 1, next_year)
        their_bid = ob.create_bid(11, 1, next_year)
        their_bid['id'] = 1234
        matching_ask = ob.match_incoming_bid(their_bid)
        assert_is_none(matching_ask)

    def test_match_ask(self):
        own_ask = ob.create_ask(11, 1, next_year)
        their_bid = ob.create_bid(12, 1, next_year)
        their_bid['id'] = 1234
        matching_bid = ob.match_ask(own_ask)
        assert_is(matching_bid, their_bid)

    def test_match_ask_without_a_match(self):
        own_ask = ob.create_ask(11, 1, next_year)
        their_bid = ob.create_bid(10, 1, next_year)
        their_bid['id'] = 1234

        matching_bid = ob.match_ask(own_ask)