def test_dump_throws_no_write_attribute(self): bson_bytes = bsonjs.loads('{ "test" : "me" }') not_file = {} self.assertRaises(AttributeError, bsonjs.dump, bson_bytes, not_file)