summaryrefslogtreecommitdiffstats
path: root/awxkit/test/cli
diff options
context:
space:
mode:
authorRyan Petrello <rpetrell@redhat.com>2019-09-01 14:17:07 +0200
committerRyan Petrello <rpetrell@redhat.com>2019-09-03 23:27:10 +0200
commit4ec5e82023e6bd3d2ed3fa3aef4063de50c7c845 (patch)
tree874c0d37205a99a0bdabc802a9116567b8baad08 /awxkit/test/cli
parentMerge pull request #4626 from ryanpetrello/more-cli-doc-examples (diff)
downloadawx-4ec5e82023e6bd3d2ed3fa3aef4063de50c7c845.tar.xz
awx-4ec5e82023e6bd3d2ed3fa3aef4063de50c7c845.zip
cli: add ability to specify a name instead of primary key
Diffstat (limited to 'awxkit/test/cli')
-rw-r--r--awxkit/test/cli/test_options.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/awxkit/test/cli/test_options.py b/awxkit/test/cli/test_options.py
index ff514ffb9a..109fc646c3 100644
--- a/awxkit/test/cli/test_options.py
+++ b/awxkit/test/cli/test_options.py
@@ -42,7 +42,7 @@ class TestOptions(unittest.TestCase):
'POST': {},
}
})
- ResourceOptionsParser(page, 'users', self.parser)
+ ResourceOptionsParser(None, page, 'users', self.parser)
assert 'list' in self.parser.choices
def test_list_filtering(self):
@@ -54,7 +54,7 @@ class TestOptions(unittest.TestCase):
},
}
})
- options = ResourceOptionsParser(page, 'users', self.parser)
+ options = ResourceOptionsParser(None, page, 'users', self.parser)
options.build_query_arguments('list', 'POST')
assert 'list' in self.parser.choices
@@ -71,7 +71,7 @@ class TestOptions(unittest.TestCase):
},
}
})
- options = ResourceOptionsParser(page, 'users', self.parser)
+ options = ResourceOptionsParser(None, page, 'users', self.parser)
options.build_query_arguments('list', 'POST')
assert 'list' in self.parser.choices
@@ -90,7 +90,7 @@ class TestOptions(unittest.TestCase):
},
}
})
- options = ResourceOptionsParser(page, 'users', self.parser)
+ options = ResourceOptionsParser(None, page, 'users', self.parser)
options.build_query_arguments('create', 'POST')
assert 'create' in self.parser.choices
@@ -110,7 +110,7 @@ class TestOptions(unittest.TestCase):
},
}
})
- options = ResourceOptionsParser(page, 'users', self.parser)
+ options = ResourceOptionsParser(None, page, 'users', self.parser)
options.build_query_arguments('create', 'POST')
assert 'create' in self.parser.choices
@@ -126,7 +126,7 @@ class TestOptions(unittest.TestCase):
},
}
})
- options = ResourceOptionsParser(page, 'job_templates', self.parser)
+ options = ResourceOptionsParser(None, page, 'job_templates', self.parser)
options.build_query_arguments('create', 'POST')
assert 'create' in self.parser.choices
@@ -142,7 +142,7 @@ class TestOptions(unittest.TestCase):
},
}
})
- options = ResourceOptionsParser(page, 'users', self.parser)
+ options = ResourceOptionsParser(None, page, 'users', self.parser)
options.build_query_arguments('create', 'POST')
assert 'create' in self.parser.choices
@@ -168,7 +168,7 @@ class TestOptions(unittest.TestCase):
},
}
})
- options = ResourceOptionsParser(page, 'users', self.parser)
+ options = ResourceOptionsParser(None, page, 'users', self.parser)
options.build_query_arguments('create', 'POST')
assert 'create' in self.parser.choices
@@ -181,13 +181,14 @@ class TestOptions(unittest.TestCase):
page = OptionsPage.from_json({
'actions': {'GET': {}, 'POST': {}}
})
- ResourceOptionsParser(page, 'users', self.parser)
+ ResourceOptionsParser(None, page, 'users', self.parser)
assert method in self.parser.choices
out = StringIO()
self.parser.choices[method].print_help(out)
assert 'positional arguments:\n id' in out.getvalue()
+
class TestSettingsOptions(unittest.TestCase):
def setUp(self):
@@ -203,7 +204,7 @@ class TestSettingsOptions(unittest.TestCase):
}
})
page.endpoint = '/settings/all/'
- ResourceOptionsParser(page, 'settings', self.parser)
+ ResourceOptionsParser(None, page, 'settings', self.parser)
assert 'list' in self.parser.choices
assert 'modify' in self.parser.choices