Skip to content

Commit b2c97d4

Browse files
author
jasper-schneider
committed
Remove tabs from ps1 files
1 parent 9f7ddaa commit b2c97d4

File tree

4 files changed

+493
-493
lines changed

4 files changed

+493
-493
lines changed

src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/BatchAccountTests.ps1

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Tests creating new Batch account.
2828
function Test-CreatesNewBatchAccount
2929
{
3030
# Setup
31-
$account = Get-BatchAccountName
31+
$account = Get-BatchAccountName
3232
$resourceGroup = Get-ResourceGroupName
3333
$location = Get-BatchAccountProviderLocation
3434

@@ -41,14 +41,14 @@ function Test-CreatesNewBatchAccount
4141
$expected = Get-AzureRmBatchAccount -Name $account -ResourceGroupName $resourceGroup
4242

4343
# Assert
44-
Assert-AreEqual $expected.AccountName $actual.AccountName
44+
Assert-AreEqual $expected.AccountName $actual.AccountName
4545
Assert-AreEqual $expected.ResourceGroupName $actual.ResourceGroupName
46-
Assert-AreEqual $expected.Location $actual.Location
46+
Assert-AreEqual $expected.Location $actual.Location
4747
Assert-AreEqual $expected.Tags[0]["Name"] $actual.Tags[0]["Name"]
48-
Assert-AreEqual $expected.Tags[0]["Value"] $actual.Tags[0]["Value"]
49-
Assert-True { $actual.CoreQuota -gt 0 }
50-
Assert-True { $actual.PoolQuota -gt 0 }
51-
Assert-True { $actual.ActiveJobAndJobScheduleQuota -gt 0 }
48+
Assert-AreEqual $expected.Tags[0]["Value"] $actual.Tags[0]["Value"]
49+
Assert-True { $actual.CoreQuota -gt 0 }
50+
Assert-True { $actual.PoolQuota -gt 0 }
51+
Assert-True { $actual.ActiveJobAndJobScheduleQuota -gt 0 }
5252
}
5353
finally
5454
{
@@ -64,7 +64,7 @@ Tests creating an account that already exists throws
6464
function Test-CreateExistingBatchAccount
6565
{
6666
# Setup
67-
$account = Get-BatchAccountName
67+
$account = Get-BatchAccountName
6868
$resourceGroup = Get-ResourceGroupName
6969
$location = Get-BatchAccountProviderLocation
7070

@@ -91,36 +91,36 @@ Tests updating existing Batch account
9191
function Test-UpdatesExistingBatchAccount
9292
{
9393
# Setup
94-
$account = Get-BatchAccountName
94+
$account = Get-BatchAccountName
9595
$resourceGroup = Get-ResourceGroupName
9696
$location = Get-BatchAccountProviderLocation
9797

98-
$tagName1 = "testtag1"
99-
$tagValue1 = "testval1"
100-
$tagName2 = "testtag2"
101-
$tagValue2 = "testval2"
98+
$tagName1 = "testtag1"
99+
$tagValue1 = "testval1"
100+
$tagName2 = "testtag2"
101+
$tagValue2 = "testval2"
102102

103103
try
104104
{
105105
New-AzureRmResourceGroup -Name $resourceGroup -Location $location
106106

107-
#Test
107+
#Test
108108
$new = New-AzureRmBatchAccount -Name $account -ResourceGroupName $resourceGroup -Location $location -Tag @{Name = $tagName1; Value = $tagValue1}
109-
Assert-AreEqual 1 $new.Tags.Count
109+
Assert-AreEqual 1 $new.Tags.Count
110110

111-
# Update Tag
111+
# Update Tag
112112
$actual = Set-AzureRmBatchAccount -Name $account -ResourceGroupName $resourceGroup -Tag @{Name = $tagName2; Value = $tagValue2}
113113
$expected = Get-AzureRmBatchAccount -Name $account -ResourceGroupName $resourceGroup
114114

115115
# Assert
116-
Assert-AreEqual $expected.AccountName $actual.AccountName
116+
Assert-AreEqual $expected.AccountName $actual.AccountName
117117
Assert-AreEqual $expected.ResourceGroupName $actual.ResourceGroupName
118-
Assert-AreEqual $expected.Location $actual.Location
119-
Assert-AreEqual 1 $expected.Tags.Count
120-
Assert-AreEqual $tagName2 $expected.Tags[0]["Name"]
121-
Assert-AreEqual $tagValue2 $expected.Tags[0]["Value"]
118+
Assert-AreEqual $expected.Location $actual.Location
119+
Assert-AreEqual 1 $expected.Tags.Count
120+
Assert-AreEqual $tagName2 $expected.Tags[0]["Name"]
121+
Assert-AreEqual $tagValue2 $expected.Tags[0]["Value"]
122122
Assert-AreEqual $expected.Tags[0]["Name"] $actual.Tags[0]["Name"]
123-
Assert-AreEqual $expected.Tags[0]["Value"] $actual.Tags[0]["Value"]
123+
Assert-AreEqual $expected.Tags[0]["Value"] $actual.Tags[0]["Value"]
124124
}
125125
finally
126126
{
@@ -137,36 +137,36 @@ function Test-GetBatchAccountsUnderResourceGroups
137137
{
138138
# Setup
139139
$resourceGroup1 = Get-ResourceGroupName
140-
$resourceGroup2 = Get-ResourceGroupName
141-
$account11 = Get-BatchAccountName
142-
$account12 = Get-BatchAccountName
143-
$account21 = Get-BatchAccountName
140+
$resourceGroup2 = Get-ResourceGroupName
141+
$account11 = Get-BatchAccountName
142+
$account12 = Get-BatchAccountName
143+
$account21 = Get-BatchAccountName
144144
$location1 = Get-BatchAccountProviderLocation
145-
$location2 = Get-BatchAccountProviderLocation 4
146-
$location3 = Get-BatchAccountProviderLocation 7
145+
$location2 = Get-BatchAccountProviderLocation 4
146+
$location3 = Get-BatchAccountProviderLocation 7
147147

148148
try
149149
{
150150
New-AzureRmResourceGroup -Name $resourceGroup1 -Location $location1
151-
New-AzureRmResourceGroup -Name $resourceGroup2 -Location $location1
152-
New-AzureRmBatchAccount -Name $account11 -ResourceGroupName $resourceGroup1 -Location $location1
153-
New-AzureRmBatchAccount -Name $account12 -ResourceGroupName $resourceGroup1 -Location $location2
154-
New-AzureRmBatchAccount -Name $account21 -ResourceGroupName $resourceGroup2 -Location $location3
151+
New-AzureRmResourceGroup -Name $resourceGroup2 -Location $location1
152+
New-AzureRmBatchAccount -Name $account11 -ResourceGroupName $resourceGroup1 -Location $location1
153+
New-AzureRmBatchAccount -Name $account12 -ResourceGroupName $resourceGroup1 -Location $location2
154+
New-AzureRmBatchAccount -Name $account21 -ResourceGroupName $resourceGroup2 -Location $location3
155155

156156
# Test
157-
$allAccounts = Get-AzureRmBatchAccount | Where-Object {$_.ResourceGroupName -eq $resourceGroup1 -or $_.ResourceGroupName -eq $resourceGroup2}
158-
$resourceGroup1Accounts = Get-AzureRmBatchAccount -ResourceGroupName $resourceGroup1
157+
$allAccounts = Get-AzureRmBatchAccount | Where-Object {$_.ResourceGroupName -eq $resourceGroup1 -or $_.ResourceGroupName -eq $resourceGroup2}
158+
$resourceGroup1Accounts = Get-AzureRmBatchAccount -ResourceGroupName $resourceGroup1
159159

160-
# Assert
161-
Assert-AreEqual 3 $allAccounts.Count
162-
Assert-AreEqual 2 $resourceGroup1Accounts.Count
163-
Assert-AreEqual 2 ($resourceGroup1Accounts | Where-Object {$_.ResourceGroupName -eq $resourceGroup1}).Count
160+
# Assert
161+
Assert-AreEqual 3 $allAccounts.Count
162+
Assert-AreEqual 2 $resourceGroup1Accounts.Count
163+
Assert-AreEqual 2 ($resourceGroup1Accounts | Where-Object {$_.ResourceGroupName -eq $resourceGroup1}).Count
164164
}
165165
finally
166166
{
167167
# Cleanup
168-
Clean-BatchAccount $account11 $resourceGroup1
169-
Clean-BatchAccountAndResourceGroup $account12 $resourceGroup1
168+
Clean-BatchAccount $account11 $resourceGroup1
169+
Clean-BatchAccountAndResourceGroup $account12 $resourceGroup1
170170
Clean-BatchAccountAndResourceGroup $account21 $resourceGroup2
171171
}
172172
}
@@ -180,28 +180,28 @@ function Test-CreateAndRemoveBatchAccountViaPiping
180180
{
181181
# Setup
182182
$account1 = Get-BatchAccountName
183-
$account2 = Get-BatchAccountName
183+
$account2 = Get-BatchAccountName
184184
$resourceGroup = Get-ResourceGroupName
185185
$location1 = Get-BatchAccountProviderLocation
186-
$location2 = Get-BatchAccountProviderLocation 4
187-
188-
try
189-
{
190-
New-AzureRmResourceGroup -Name $resourceGroup -Location $location1
191-
192-
# Test
193-
New-AzureRmBatchAccount -Name $account1 -ResourceGroupName $resourceGroup -Location $location1
194-
New-AzureRmBatchAccount -Name $account2 -ResourceGroupName $resourceGroup -Location $location2
195-
Get-AzureRmBatchAccount | where {$_.AccountName -eq $account1 -or $_.AccountName -eq $account2} | Remove-AzureRmBatchAccount -Force
196-
197-
# Assert
198-
Assert-Throws { Get-AzureRmBatchAccount -Name $account1 }
199-
Assert-Throws { Get-AzureRmBatchAccount -Name $account2 }
200-
}
201-
finally
202-
{
203-
Clean-ResourceGroup $resourceGroup
204-
}
186+
$location2 = Get-BatchAccountProviderLocation 4
187+
188+
try
189+
{
190+
New-AzureRmResourceGroup -Name $resourceGroup -Location $location1
191+
192+
# Test
193+
New-AzureRmBatchAccount -Name $account1 -ResourceGroupName $resourceGroup -Location $location1
194+
New-AzureRmBatchAccount -Name $account2 -ResourceGroupName $resourceGroup -Location $location2
195+
Get-AzureRmBatchAccount | where {$_.AccountName -eq $account1 -or $_.AccountName -eq $account2} | Remove-AzureRmBatchAccount -Force
196+
197+
# Assert
198+
Assert-Throws { Get-AzureRmBatchAccount -Name $account1 }
199+
Assert-Throws { Get-AzureRmBatchAccount -Name $account2 }
200+
}
201+
finally
202+
{
203+
Clean-ResourceGroup $resourceGroup
204+
}
205205
}
206206

207207
<#
@@ -211,7 +211,7 @@ Tests getting/setting Batch account keys
211211
function Test-BatchAccountKeys
212212
{
213213
# Setup
214-
$account = Get-BatchAccountName
214+
$account = Get-BatchAccountName
215215
$resourceGroup = Get-ResourceGroupName
216216
$location = Get-BatchAccountProviderLocation
217217

@@ -221,25 +221,25 @@ function Test-BatchAccountKeys
221221

222222
# Test
223223
$new = New-AzureRmBatchAccount -Name $account -ResourceGroupName $resourceGroup -Location $location -Tag @{Name = "testtag"; Value = "testval"}
224-
$originalKeys = Get-AzureRmBatchAccountKeys -Name $account -ResourceGroupName $resourceGroup
225-
$originalPrimaryKey = $originalKeys.PrimaryAccountKey
226-
$originalSecondaryKey = $originalKeys.SecondaryAccountKey
227-
$newPrimary = New-AzureRmBatchAccountKey -Name $account -ResourceGroupName $resourceGroup -KeyType Primary
228-
$newSecondary = New-AzureRmBatchAccountKey -Name $account -ResourceGroupName $resourceGroup -KeyType Secondary
224+
$originalKeys = Get-AzureRmBatchAccountKeys -Name $account -ResourceGroupName $resourceGroup
225+
$originalPrimaryKey = $originalKeys.PrimaryAccountKey
226+
$originalSecondaryKey = $originalKeys.SecondaryAccountKey
227+
$newPrimary = New-AzureRmBatchAccountKey -Name $account -ResourceGroupName $resourceGroup -KeyType Primary
228+
$newSecondary = New-AzureRmBatchAccountKey -Name $account -ResourceGroupName $resourceGroup -KeyType Secondary
229229
$finalKeys = Get-AzureRmBatchAccountKeys -Name $account -ResourceGroupName $resourceGroup
230-
$getAccountResult = Get-AzureRmBatchAccount -Name $account -ResourceGroupName $resourceGroup
230+
$getAccountResult = Get-AzureRmBatchAccount -Name $account -ResourceGroupName $resourceGroup
231231

232232
# Assert
233-
Assert-AreEqual $null $new.PrimaryAccountKey
233+
Assert-AreEqual $null $new.PrimaryAccountKey
234234
Assert-AreEqual $null $new.SecondaryAccountKey
235-
Assert-AreEqual $originalSecondaryKey $newPrimary.SecondaryAccountKey
236-
Assert-AreEqual $newPrimary.PrimaryAccountKey $newSecondary.PrimaryAccountKey
237-
Assert-AreEqual $newPrimary.PrimaryAccountKey $finalKeys.PrimaryAccountKey
238-
Assert-AreEqual $newSecondary.SecondaryAccountKey $finalKeys.SecondaryAccountKey
239-
Assert-AreNotEqual $originalPrimaryKey $newPrimary.PrimaryAccountKey
240-
Assert-AreNotEqual $originalSecondaryKey $newSecondary.SecondaryAccountKey
241-
Assert-AreEqual $null $getAccountResult.PrimaryAccountKey
242-
Assert-AreEqual $null $getAccountResult.SecondaryAccountKey
235+
Assert-AreEqual $originalSecondaryKey $newPrimary.SecondaryAccountKey
236+
Assert-AreEqual $newPrimary.PrimaryAccountKey $newSecondary.PrimaryAccountKey
237+
Assert-AreEqual $newPrimary.PrimaryAccountKey $finalKeys.PrimaryAccountKey
238+
Assert-AreEqual $newSecondary.SecondaryAccountKey $finalKeys.SecondaryAccountKey
239+
Assert-AreNotEqual $originalPrimaryKey $newPrimary.PrimaryAccountKey
240+
Assert-AreNotEqual $originalSecondaryKey $newSecondary.SecondaryAccountKey
241+
Assert-AreEqual $null $getAccountResult.PrimaryAccountKey
242+
Assert-AreEqual $null $getAccountResult.SecondaryAccountKey
243243
}
244244
finally
245245
{

src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/Common.ps1

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,31 @@ Gets the location for the Batch account provider. Default to West US if none fou
3636
#>
3737
function Get-BatchAccountProviderLocation($index)
3838
{
39-
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
40-
{
41-
$namespace = "Microsoft.Batch"
42-
$type = "batchAccounts"
43-
$r = Get-AzureRmResourceProvider -ProviderNamespace $namespace | where {$_.ResourceTypes[0].ResourceTypeName -eq $type}
44-
$location = $r.Locations
39+
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
40+
{
41+
$namespace = "Microsoft.Batch"
42+
$type = "batchAccounts"
43+
$r = Get-AzureRmResourceProvider -ProviderNamespace $namespace | where {$_.ResourceTypes[0].ResourceTypeName -eq $type}
44+
$location = $r.Locations
4545

46-
if ($location -eq $null)
47-
{
48-
return "West US"
49-
}
50-
else
51-
{
52-
if ($index -eq $null)
53-
{
54-
return "West US"
55-
}
56-
else
57-
{
58-
return $location[$index]
59-
}
60-
}
61-
}
46+
if ($location -eq $null)
47+
{
48+
return "West US"
49+
}
50+
else
51+
{
52+
if ($index -eq $null)
53+
{
54+
return "West US"
55+
}
56+
else
57+
{
58+
return $location[$index]
59+
}
60+
}
61+
}
6262

63-
return "West US"
63+
return "West US"
6464
}
6565

6666
<#
@@ -70,7 +70,7 @@ Cleans the created Batch account and resource group
7070
function Clean-BatchAccountAndResourceGroup($accountName,$resourceGroup)
7171
{
7272
Clean-BatchAccount $accountName $resourceGroup
73-
Clean-ResourceGroup $resourceGroup
73+
Clean-ResourceGroup $resourceGroup
7474
}
7575

7676
<#
@@ -80,7 +80,7 @@ Cleans the created Batch account
8080
function Clean-BatchAccount($accountName,$resourceGroup)
8181
{
8282
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
83-
{
83+
{
8484
Remove-AzureRmBatchAccount -Name $accountName -ResourceGroupName $resourceGroup -Force
8585
}
8686
}
@@ -91,8 +91,8 @@ Cleans the created resource group
9191
#>
9292
function Clean-ResourceGroup($resourceGroup)
9393
{
94-
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
95-
{
94+
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
95+
{
9696
Remove-AzureRmResourceGroup -Name $resourceGroup -Force
9797
}
9898
}

0 commit comments

Comments
 (0)