+ def test_unicode_must_be_ascii(self):
+ # If unicode type, must only consist of valid ASCII
+ foo_locator = self.keep_client.put(u'foo')
+ self.assertRegexpMatches(
+ foo_locator,
+ '^acbd18db4cc2f85cedef654fccc4a4d8\+3',
+ 'wrong md5 hash from Keep.put("foo"): ' + foo_locator)
+
+ with self.assertRaises(UnicodeEncodeError):
+ # Error if it is not ASCII
+ self.keep_client.put(u'\xe2')
+
+ with self.assertRaises(arvados.errors.ArgumentError):
+ # Must be a string type
+ self.keep_client.put({})