Skip to content

Commit e83a5e9

Browse files
committed
fix test
1 parent a1aa503 commit e83a5e9

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTests.ps1

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,9 +1180,9 @@ function Policy-CrudTest {
11801180
$set = Set-AzureRmApiManagementPolicy -Context $context -Policy $tenantValid -PassThru
11811181
Assert-AreEqual $true $set
11821182

1183-
Get-AzureRmApiManagementPolicy -Context $context -SaveAs 'TenantPolicy.xml' -Force
1184-
$exists = [System.IO.File]::Exists('TenantPolicy.xml')
1185-
$policy = gc 'TenantPolicy.xml'
1183+
Get-AzureRmApiManagementPolicy -Context $context -SaveAs "$TestOutputRoot/TenantPolicy.xml" -Force
1184+
$exists = [System.IO.File]::Exists("$TestOutputRoot/TenantPolicy.xml")
1185+
$policy = gc "$TestOutputRoot/TenantPolicy.xml"
11861186
Assert-True {$policy -like '*<find-and-replace from="aaa" to="BBB" />*'}
11871187
}
11881188
finally {
@@ -1200,9 +1200,9 @@ function Policy-CrudTest {
12001200
$set = Set-AzureRmApiManagementPolicy -Context $context -Policy $productValid -ProductId $product.ProductId -PassThru
12011201
Assert-AreEqual $true $set
12021202

1203-
Get-AzureRmApiManagementPolicy -Context $context -ProductId $product.ProductId -SaveAs 'ProductPolicy.xml' -Force
1204-
$exists = [System.IO.File]::Exists('ProductPolicy.xml')
1205-
$policy = gc 'ProductPolicy.xml'
1203+
Get-AzureRmApiManagementPolicy -Context $context -ProductId $product.ProductId -SaveAs "$TestOutputRoot/ProductPolicy.xml" -Force
1204+
$exists = [System.IO.File]::Exists("$TestOutputRoot/ProductPolicy.xml")
1205+
$policy = gc "$TestOutputRoot/ProductPolicy.xml"
12061206
Assert-True {$policy -like '*<rate-limit calls="5" renewal-period="60" />*'}
12071207
}
12081208
finally {
@@ -1213,7 +1213,7 @@ function Policy-CrudTest {
12131213
Assert-Null $policy
12141214

12151215
try {
1216-
rm 'ProductPolicy.xml'
1216+
rm "$TestOutputRoot/ProductPolicy.xml"
12171217
}
12181218
catch {}
12191219
}
@@ -1225,9 +1225,9 @@ function Policy-CrudTest {
12251225
$set = Set-AzureRmApiManagementPolicy -Context $context -Policy $apiValid -ApiId $api.ApiId -PassThru
12261226
Assert-AreEqual $true $set
12271227

1228-
$policy = Get-AzureRmApiManagementPolicy -Context $context -ApiId $api.ApiId -SaveAs 'ApiPolicy.xml' -Force
1229-
$exists = [System.IO.File]::Exists('ApiPolicy.xml')
1230-
$policy = gc 'ApiPolicy.xml'
1228+
$policy = Get-AzureRmApiManagementPolicy -Context $context -ApiId $api.ApiId -SaveAs "$TestOutputRoot/ApiPolicy.xml" -Force
1229+
$exists = [System.IO.File]::Exists("$TestOutputRoot/ApiPolicy.xml")
1230+
$policy = gc "$TestOutputRoot/ApiPolicy.xml"
12311231
Assert-True {$policy -like '*<cache-lookup vary-by-developer="false" vary-by-developer-groups="false" downstream-caching-type="none">*'}
12321232
}
12331233
finally {
@@ -1238,7 +1238,7 @@ function Policy-CrudTest {
12381238
Assert-Null $policy
12391239

12401240
try {
1241-
rm 'ApiPolicy.xml'
1241+
rm "$TestOutputRoot/ApiPolicy.xml"
12421242
}
12431243
catch {}
12441244
}
@@ -1253,9 +1253,9 @@ function Policy-CrudTest {
12531253
Assert-AreEqual $true $set
12541254

12551255
$policy = Get-AzureRmApiManagementPolicy -Context $context -ApiId $api.ApiId -OperationId $operation.OperationId `
1256-
-SaveAs 'OperationPolicy.xml' -Force
1257-
$exists = [System.IO.File]::Exists('OperationPolicy.xml')
1258-
$policy = gc 'OperationPolicy.xml'
1256+
-SaveAs "$TestOutputRoot/OperationPolicy.xml" -Force
1257+
$exists = [System.IO.File]::Exists("$TestOutputRoot/OperationPolicy.xml")
1258+
$policy = gc "$TestOutputRoot/OperationPolicy.xml"
12591259
Assert-True {$policy -like '*<rewrite-uri template="/resource" />*'}
12601260
}
12611261
finally {
@@ -1266,7 +1266,7 @@ function Policy-CrudTest {
12661266
Assert-Null $policy
12671267

12681268
try {
1269-
rm 'OperationPolicy.xml'
1269+
rm "$TestOutputRoot/OperationPolicy.xml"
12701270
}
12711271
catch {}
12721272
}

0 commit comments

Comments
 (0)