59 |
assert id != id3 |
assert id != id3 |
60 |
assert id.hashCode() != id3.hashCode() |
assert id.hashCode() != id3.hashCode() |
61 |
|
|
62 |
|
def testSpaces(): |
63 |
|
"""Spaces in content types must throw exceptions""" |
64 |
|
str = ("urn:x-storm:1.0:%s," |
65 |
|
"u7uu5zpmkoeykkwhxd4unlqycc36gvl7." |
66 |
|
"jtlcbiy2r6gfsznbgj42yzqbqk4ti373bqs5qyy") |
67 |
|
|
68 |
|
BlockId(str % 'text/plain;charset=UTF-8') |
69 |
|
|
70 |
|
try: BlockId(str % 'text/plain; charset=UTF-8') |
71 |
|
except java.lang.IllegalArgumentException: pass |
72 |
|
else: assert 0 |
73 |
|
|
74 |
|
sha1 = com.bitzi.util.Base32.decode( |
75 |
|
"u7uu5zpmkoeykkwhxd4unlqycc36gvl7") |
76 |
|
tiger = com.bitzi.util.Base32.decode( |
77 |
|
"jtlcbiy2r6gfsznbgj42yzqbqk4ti373bqs5qyy") |
78 |
|
BlockId("text/plain;charset=UTF-8", sha1, tiger) |
79 |
|
|
80 |
|
try: BlockId("text/plain; charset=UTF-8", sha1, tiger) |
81 |
|
except java.lang.IllegalArgumentException: pass |
82 |
|
else: assert 0 |
83 |
|
|
84 |
|
|
85 |
def testXType(): |
def testXType(): |
86 |
"""X- content types must throw exceptions""" |
"""X- content types must throw exceptions""" |
87 |
|
|