mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
Reformat everything.
This commit is contained in:
@@ -22,31 +22,22 @@ def load_file(file):
|
||||
MOCK_ENTRIES = {
|
||||
OnePassCLIv1: [
|
||||
{
|
||||
'vault_name': 'Acme "Quot\'d" Servers',
|
||||
'queries': [
|
||||
'0123456789',
|
||||
'Mock "Quot\'d" Server'
|
||||
],
|
||||
'expected': ['t0pS3cret', 't0pS3cret'],
|
||||
'output': load_file("v1_out_01.json"),
|
||||
"vault_name": 'Acme "Quot\'d" Servers',
|
||||
"queries": ["0123456789", 'Mock "Quot\'d" Server'],
|
||||
"expected": ["t0pS3cret", "t0pS3cret"],
|
||||
"output": load_file("v1_out_01.json"),
|
||||
},
|
||||
{
|
||||
'vault_name': 'Acme Logins',
|
||||
'queries': [
|
||||
'9876543210',
|
||||
'Mock Website',
|
||||
'acme.com'
|
||||
],
|
||||
'expected': ['t0pS3cret', 't0pS3cret', 't0pS3cret'],
|
||||
'output': load_file("v1_out_02.json"),
|
||||
"vault_name": "Acme Logins",
|
||||
"queries": ["9876543210", "Mock Website", "acme.com"],
|
||||
"expected": ["t0pS3cret", "t0pS3cret", "t0pS3cret"],
|
||||
"output": load_file("v1_out_02.json"),
|
||||
},
|
||||
{
|
||||
'vault_name': 'Acme Logins',
|
||||
'queries': [
|
||||
'864201357'
|
||||
],
|
||||
'expected': ['vauxhall'],
|
||||
'output': load_file("v1_out_03.json"),
|
||||
"vault_name": "Acme Logins",
|
||||
"queries": ["864201357"],
|
||||
"expected": ["vauxhall"],
|
||||
"output": load_file("v1_out_03.json"),
|
||||
},
|
||||
],
|
||||
OnePassCLIv2: [
|
||||
@@ -67,7 +58,7 @@ MOCK_ENTRIES = {
|
||||
"field": "password1",
|
||||
},
|
||||
"expected": ["data in custom field"],
|
||||
"output": load_file("v2_out_02.json")
|
||||
"output": load_file("v2_out_02.json"),
|
||||
},
|
||||
{
|
||||
# Request data from a custom section
|
||||
@@ -78,7 +69,7 @@ MOCK_ENTRIES = {
|
||||
"section": "Section 2",
|
||||
},
|
||||
"expected": ["first value"],
|
||||
"output": load_file("v2_out_03.json")
|
||||
"output": load_file("v2_out_03.json"),
|
||||
},
|
||||
{
|
||||
# Request data from an omitted value (label lookup, no section)
|
||||
@@ -88,7 +79,7 @@ MOCK_ENTRIES = {
|
||||
"field": "label-without-value",
|
||||
},
|
||||
"expected": [""],
|
||||
"output": load_file("v2_out_04.json")
|
||||
"output": load_file("v2_out_04.json"),
|
||||
},
|
||||
{
|
||||
# Request data from an omitted value (id lookup, no section)
|
||||
@@ -98,18 +89,15 @@ MOCK_ENTRIES = {
|
||||
"field": "67890q7mspf4x6zrlw3qejn7m",
|
||||
},
|
||||
"expected": [""],
|
||||
"output": load_file("v2_out_04.json")
|
||||
"output": load_file("v2_out_04.json"),
|
||||
},
|
||||
{
|
||||
# Request data from an omitted value (label lookup, with section)
|
||||
"vault_name": "Test Vault",
|
||||
"queries": ["Omitted values"],
|
||||
"kwargs": {
|
||||
"field": "section-label-without-value",
|
||||
"section": "Section-Without-Values"
|
||||
},
|
||||
"kwargs": {"field": "section-label-without-value", "section": "Section-Without-Values"},
|
||||
"expected": [""],
|
||||
"output": load_file("v2_out_04.json")
|
||||
"output": load_file("v2_out_04.json"),
|
||||
},
|
||||
{
|
||||
# Request data from an omitted value (id lookup, with section)
|
||||
@@ -120,7 +108,7 @@ MOCK_ENTRIES = {
|
||||
"section": "section-without-values",
|
||||
},
|
||||
"expected": [""],
|
||||
"output": load_file("v2_out_04.json")
|
||||
"output": load_file("v2_out_04.json"),
|
||||
},
|
||||
{
|
||||
# Query item without section by lowercase id (case matching)
|
||||
@@ -130,7 +118,7 @@ MOCK_ENTRIES = {
|
||||
"field": "lowercaseid",
|
||||
},
|
||||
"expected": ["lowercaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item without section by lowercase id (case not matching)
|
||||
@@ -140,7 +128,7 @@ MOCK_ENTRIES = {
|
||||
"field": "LOWERCASEID",
|
||||
},
|
||||
"expected": ["lowercaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item without section by lowercase label (case matching)
|
||||
@@ -150,7 +138,7 @@ MOCK_ENTRIES = {
|
||||
"field": "lowercaselabel",
|
||||
},
|
||||
"expected": ["lowercaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item without section by lowercase label (case not matching)
|
||||
@@ -160,7 +148,7 @@ MOCK_ENTRIES = {
|
||||
"field": "LOWERCASELABEL",
|
||||
},
|
||||
"expected": ["lowercaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item without section by mixed case id (case matching)
|
||||
@@ -170,7 +158,7 @@ MOCK_ENTRIES = {
|
||||
"field": "MiXeDcAsEiD",
|
||||
},
|
||||
"expected": ["mixedcaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item without section by mixed case id (case not matching)
|
||||
@@ -180,7 +168,7 @@ MOCK_ENTRIES = {
|
||||
"field": "mixedcaseid",
|
||||
},
|
||||
"expected": ["mixedcaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item without section by mixed case label (case matching)
|
||||
@@ -190,7 +178,7 @@ MOCK_ENTRIES = {
|
||||
"field": "MiXeDcAsElAbEl",
|
||||
},
|
||||
"expected": ["mixedcaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item without section by mixed case label (case not matching)
|
||||
@@ -200,7 +188,7 @@ MOCK_ENTRIES = {
|
||||
"field": "mixedcaselabel",
|
||||
},
|
||||
"expected": ["mixedcaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase id (case matching)
|
||||
@@ -211,7 +199,7 @@ MOCK_ENTRIES = {
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionlowercaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase id (case not matching)
|
||||
@@ -222,7 +210,7 @@ MOCK_ENTRIES = {
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionlowercaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase label (case matching)
|
||||
@@ -233,7 +221,7 @@ MOCK_ENTRIES = {
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionlowercaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase label (case not matching)
|
||||
@@ -244,7 +232,7 @@ MOCK_ENTRIES = {
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionlowercaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase id (case matching)
|
||||
@@ -255,7 +243,7 @@ MOCK_ENTRIES = {
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionmixedcaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase id (case not matching)
|
||||
@@ -266,7 +254,7 @@ MOCK_ENTRIES = {
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionmixedcaseid"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase label (case matching)
|
||||
@@ -277,7 +265,7 @@ MOCK_ENTRIES = {
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionmixedcaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
{
|
||||
# Query item with section by lowercase label (case not matching)
|
||||
@@ -288,7 +276,7 @@ MOCK_ENTRIES = {
|
||||
"section": "section-with-values",
|
||||
},
|
||||
"expected": ["sectionmixedcaselabel"],
|
||||
"output": load_file("v2_out_05.json")
|
||||
"output": load_file("v2_out_05.json"),
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -298,9 +286,7 @@ SSH_KEY_MOCK_ENTRIES = [
|
||||
{
|
||||
"vault_name": "Personal",
|
||||
"queries": ["ssh key"],
|
||||
"expected": [
|
||||
"-----BEGIN PRIVATE KEY-----\n..........=\n-----END PRIVATE KEY-----\n"
|
||||
],
|
||||
"expected": ["-----BEGIN PRIVATE KEY-----\n..........=\n-----END PRIVATE KEY-----\n"],
|
||||
"output": load_file("ssh_key_output.json"),
|
||||
},
|
||||
# loads private key in PKCS#8 format becasue ssh_format=false
|
||||
@@ -310,9 +296,7 @@ SSH_KEY_MOCK_ENTRIES = [
|
||||
"kwargs": {
|
||||
"ssh_format": False,
|
||||
},
|
||||
"expected": [
|
||||
"-----BEGIN PRIVATE KEY-----\n..........=\n-----END PRIVATE KEY-----\n"
|
||||
],
|
||||
"expected": ["-----BEGIN PRIVATE KEY-----\n..........=\n-----END PRIVATE KEY-----\n"],
|
||||
"output": load_file("ssh_key_output.json"),
|
||||
},
|
||||
# loads private key in ssh format
|
||||
@@ -322,9 +306,7 @@ SSH_KEY_MOCK_ENTRIES = [
|
||||
"kwargs": {
|
||||
"ssh_format": True,
|
||||
},
|
||||
"expected": [
|
||||
"-----BEGIN OPENSSH PRIVATE KEY-----\r\n.....\r\n-----END OPENSSH PRIVATE KEY-----\r\n"
|
||||
],
|
||||
"expected": ["-----BEGIN OPENSSH PRIVATE KEY-----\r\n.....\r\n-----END OPENSSH PRIVATE KEY-----\r\n"],
|
||||
"output": load_file("ssh_key_output.json"),
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user