Skip to content

Commit 5a61a95

Browse files
CLI unit tests
1 parent 793e375 commit 5a61a95

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

SoftLayer/CLI/tags/delete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def cli(env, identifier, name):
2020
tag_name = identifier
2121
# If the identifier is a int, and user didn't tell us it was a name.
2222
if str.isdigit(identifier) and not name:
23-
tag = tag_manager.get_tag(tag_id)
23+
tag = tag_manager.get_tag(identifier)
2424
tag_name = tag.get('name', None)
2525

2626

SoftLayer/CLI/tags/taggable.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33

44
import click
55

6-
from SoftLayer.CLI.exceptions import ArgumentError
76
from SoftLayer.CLI import formatting
87
from SoftLayer.managers.tags import TagManager
98
from SoftLayer.CLI import environment
109

11-
from pprint import pprint as pp
1210
@click.command()
1311
@environment.pass_env
1412
def cli(env):
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
advancedSearch = [
2+
{
3+
"relevanceScore": "4",
4+
"resourceType": "SoftLayer_Hardware",
5+
"resource": {
6+
"accountId": 307608,
7+
"domain": "vmware.test.com",
8+
"fullyQualifiedDomainName": "host14.vmware.test.com",
9+
"hardwareStatusId": 5,
10+
"hostname": "host14",
11+
"id": 123456,
12+
"manufacturerSerialNumber": "AAAAAAAAA",
13+
"notes": "A test notes",
14+
"provisionDate": "2018-08-24T12:32:10-06:00",
15+
"serialNumber": "SL12345678",
16+
"serviceProviderId": 1,
17+
"hardwareStatus": {
18+
"id": 5,
19+
"status": "ACTIVE"
20+
}
21+
}
22+
}
23+
]

SoftLayer/fixtures/SoftLayer_Tag.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,10 @@
2222
getObject = getAttachedTagsForCurrentUser[0]
2323

2424
getTagByTagName = getAttachedTagsForCurrentUser
25+
26+
getAllTagTypes = [
27+
{
28+
"description": "Hardware",
29+
"keyName": "HARDWARE"
30+
}
31+
]

0 commit comments

Comments
 (0)