mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
* Fix unit tests so that they correctly handle 404 missing asset response
* I didn't think there were tests in this area - my bad
This commit is contained in:
@@ -80,8 +80,7 @@ namespace OpenSim.Tests.Common.Setup
|
||||
|
||||
public static void BaseFetchExistingAssetMetaDataTest(AssetBase asset, BaseGetAssetStreamHandler handler, OSHttpResponse response)
|
||||
{
|
||||
XmlSerializer xs =
|
||||
new XmlSerializer(typeof(AssetMetadata));
|
||||
XmlSerializer xs = new XmlSerializer(typeof(AssetMetadata));
|
||||
|
||||
byte[] expected = ServerUtils.SerializeResult(xs, asset.Metadata);
|
||||
|
||||
@@ -112,9 +111,12 @@ namespace OpenSim.Tests.Common.Setup
|
||||
return asset;
|
||||
}
|
||||
|
||||
public static void BaseFetchMissingAsset(BaseGetAssetStreamHandler handler)
|
||||
public static void BaseFetchMissingAsset(BaseGetAssetStreamHandler handler, OSHttpResponse response)
|
||||
{
|
||||
Assert.AreEqual(BaseRequestHandlerTestHelper.EmptyByteArray, handler.Handle("/assets/" + Guid.NewGuid(), null, null, null), "Failed on bad guid.");
|
||||
Assert.AreEqual(
|
||||
BaseRequestHandlerTestHelper.EmptyByteArray,
|
||||
handler.Handle("/assets/" + Guid.NewGuid(), null, null, response), "Failed on bad guid.");
|
||||
Assert.AreEqual((int)HttpStatusCode.NotFound, response.StatusCode, "Response code wrong in BaseFetchMissingAsset");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user