Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
configdb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ai
configdb
Commits
e5dc6836
"git@git.autistici.org:ai/noblogs-wp.git" did not exist on "d131a2efcb7d221b4bfe2d1082833006f8102b24"
Commit
e5dc6836
authored
12 years ago
by
joe
Browse files
Options
Downloads
Patches
Plain Diff
added a test for names with slashes (WiP)
parent
9773c6ca
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
configdb/server/wsgiapp.py
+2
-2
2 additions, 2 deletions
configdb/server/wsgiapp.py
configdb/tests/db_api_test_base.py
+10
-3
10 additions, 3 deletions
configdb/tests/db_api_test_base.py
configdb/tests/test_cli.py
+10
-2
10 additions, 2 deletions
configdb/tests/test_cli.py
with
22 additions
and
7 deletions
configdb/server/wsgiapp.py
+
2
−
2
View file @
e5dc6836
This diff is collapsed.
Click to expand it.
configdb/tests/db_api_test_base.py
+
10
−
3
View file @
e5dc6836
...
@@ -15,6 +15,8 @@ class DbApiTestBase(object):
...
@@ -15,6 +15,8 @@ class DbApiTestBase(object):
a
.
roles
.
append
(
r
)
a
.
roles
.
append
(
r
)
r
=
self
.
db
.
create
(
'
role
'
,
{
'
name
'
:
u
'
role1b
'
},
s
)
r
=
self
.
db
.
create
(
'
role
'
,
{
'
name
'
:
u
'
role1b
'
},
s
)
a
.
roles
.
append
(
r
)
a
.
roles
.
append
(
r
)
r
=
self
.
db
.
create
(
'
role
'
,
{
'
name
'
:
u
'
a/i
'
},
s
)
a
.
roles
.
append
(
r
)
s
.
add
(
a
)
s
.
add
(
a
)
r2
=
self
.
db
.
create
(
'
role
'
,
{
'
name
'
:
u
'
role2
'
},
s
)
r2
=
self
.
db
.
create
(
'
role
'
,
{
'
name
'
:
u
'
role2
'
},
s
)
...
@@ -51,6 +53,11 @@ class DbApiTestBase(object):
...
@@ -51,6 +53,11 @@ class DbApiTestBase(object):
self
.
api
.
get
,
self
.
api
.
get
,
'
whrarggh
'
,
'
obz
'
,
self
.
ctx
)
'
whrarggh
'
,
'
obz
'
,
self
.
ctx
)
def
test_get_entity_with_slash
(
self
):
result
=
self
.
api
.
get
(
'
role
'
,
'
a/i
'
,
self
.
ctx
)
self
.
assertTrue
(
result
is
not
None
)
self
.
assertEquals
(
'
a/i
'
,
result
.
name
)
def
test_find
(
self
):
def
test_find
(
self
):
result
=
list
(
result
=
list
(
self
.
api
.
find
(
'
host
'
,
self
.
api
.
find
(
'
host
'
,
...
@@ -94,7 +101,7 @@ class DbApiTestBase(object):
...
@@ -94,7 +101,7 @@ class DbApiTestBase(object):
def
test_find_empty_query
(
self
):
def
test_find_empty_query
(
self
):
result
=
list
(
result
=
list
(
self
.
api
.
find
(
'
role
'
,
{},
self
.
ctx
))
self
.
api
.
find
(
'
role
'
,
{},
self
.
ctx
))
self
.
assertEquals
(
3
,
len
(
result
))
self
.
assertEquals
(
4
,
len
(
result
))
def
test_find_multiple_criteria
(
self
):
def
test_find_multiple_criteria
(
self
):
result
=
list
(
result
=
list
(
...
...
This diff is collapsed.
Click to expand it.
configdb/tests/test_cli.py
+
10
−
2
View file @
e5dc6836
...
@@ -83,6 +83,15 @@ class CliTest(mox.MoxTestBase):
...
@@ -83,6 +83,15 @@ class CliTest(mox.MoxTestBase):
self
.
assertEquals
(
self
.
assertEquals
(
0
,
cli
.
main
([
'
host
'
,
'
get
'
,
'
obz
'
]))
0
,
cli
.
main
([
'
host
'
,
'
get
'
,
'
obz
'
]))
def
test_get_object_with_slash
(
self
):
self
.
_connect
()
self
.
conn
.
get
(
'
host
'
,
'
a/i e
'
).
AndReturn
(
'
ok
'
)
self
.
mox
.
ReplayAll
()
self
.
assertEquals
(
0
,
cli
.
main
([
'
host
'
,
'
get
'
,
'
a/i e
'
]))
def
test_find_object
(
self
):
def
test_find_object
(
self
):
self
.
_connect
()
self
.
_connect
()
self
.
conn
.
find
(
'
host
'
,
query
.
Query
(
name
=
query
.
Equals
(
'
obz
'
))
self
.
conn
.
find
(
'
host
'
,
query
.
Query
(
name
=
query
.
Equals
(
'
obz
'
))
...
@@ -236,4 +245,3 @@ class CliTest(mox.MoxTestBase):
...
@@ -236,4 +245,3 @@ class CliTest(mox.MoxTestBase):
self
.
assertEquals
(
self
.
assertEquals
(
0
,
cli
.
main
(
0
,
cli
.
main
(
[
'
audit
'
,
'
--entity=host
'
,
'
--object=obz
'
]))
[
'
audit
'
,
'
--entity=host
'
,
'
--object=obz
'
]))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment