Skip to content

Commit

Permalink
#1, #9: Added tests of the _add_order().
Browse files Browse the repository at this point in the history
  • Loading branch information
Bystroushaak committed Oct 6, 2014
1 parent 7ac61fe commit 28eeec2
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion src/edeposit/amqp/ltp/tests/unittests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,38 @@ def test_calc_dir_size():


def test_remove_hairs():
assert ltp._remove_hairs(",a-sd,-/") == "a-sd"
assert ltp._remove_hairs(",a-sd,-/") == "a-sd"


def test_add_order():
unordered = {
"size": 1,
"created": 1,
"mainmets": 1,
"creator": 1,
"titleid": 1,
"itemlist": 1,
"collection": 1,
"checksum": 1,
"packageid": 1,
"institution": 1,
"metadataversion": 1,
"something_random": "yey"
}

ordered = ltp._add_order(unordered)

assert ordered.keys() == [
"created",
"metadataversion",
"packageid",
"mainmets",
"titleid",
"collection",
"institution",
"creator",
"size",
"itemlist",
"checksum",
"something_random"
]

0 comments on commit 28eeec2

Please sign in to comment.