Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ipaaca
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ramin Yaghoubzadeh Torky
ipaaca
Commits
d880537d
Commit
d880537d
authored
13 years ago
by
Herwin van Welbergen
Browse files
Options
Downloads
Patches
Plain Diff
Fixed one test case and removed two duplicated ones.
parent
5a149522
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/test/src/testipaaca.py
+11
-26
11 additions, 26 deletions
python/test/src/testipaaca.py
with
11 additions
and
26 deletions
python/test/src/testipaaca.py
+
11
−
26
View file @
d880537d
...
...
@@ -69,16 +69,22 @@ class IpaacaCommitTestCases(unittest.TestCase):
self
.
ob
.
add
(
self
.
iu
)
time
.
sleep
(
0.1
)
self
.
iu
.
commit
()
with
self
.
assertRaises
(
ipaaca
.
IUCommittedError
)
:
try
:
self
.
iu
.
payload
[
'
data
'
]
=
'
updatedData
'
self
.
fail
(
"
Expected an IUCommittedError but it was not raised.
"
)
except
ipaaca
.
IUCommittedError
,
e
:
pass
def
testCommitAndRemoteWrite
(
self
):
self
.
ob
.
add
(
self
.
iu
)
time
.
sleep
(
0.1
)
self
.
iu
.
commit
()
time
.
sleep
(
0.1
)
received_iu
=
self
.
ib
.
iu_store
[
self
.
iu
.
uid
]
with
self
.
assertRaises
(
ipaaca
.
IUCommittedError
)
:
try
:
received_iu
.
payload
[
'
data
'
]
=
'
updatedData
'
self
.
fail
(
"
Expected an IUCommittedError but it was not raised.
"
)
except
ipaaca
.
IUCommittedError
,
e
:
pass
class
IpaacaLinksTestCase
(
unittest
.
TestCase
):
...
...
@@ -118,27 +124,6 @@ class IpaacaLinksTestCase(unittest.TestCase):
grinlinks
=
received_iu
.
get_links
(
'
grin
'
)
self
.
assertEqual
(
len
(
grinlinks
),
0
)
class
IpaacaCommitTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
ib
=
ipaaca
.
InputBuffer
(
'
TestIn
'
,
[
'
sensorcategory
'
])
self
.
ib
.
register_handler
(
handle_iu_event
)
self
.
ob
=
ipaaca
.
OutputBuffer
(
'
TestOut
'
)
self
.
sensor_iu
=
ipaaca
.
IU
(
'
sensorcategory
'
)
self
.
sensor_iu
.
payload
=
{
'
data
'
:
'
sensordata
'
}
time
.
sleep
(
0.1
)
self
.
ob
.
add
(
self
.
sensor_iu
)
time
.
sleep
(
0.1
)
def
tearDown
(
self
):
pass
def
testCommitAndLocalWrite
(
self
):
self
.
sensor_iu
.
commit
()
with
self
.
assertRaises
(
ipaaca
.
IUCommittedError
):
self
.
sensor_iu
.
payload
[
'
data
'
]
=
'
updatedData
'
def
testCommitAndRemoteWrite
(
self
):
self
.
sensor_iu
.
commit
()
received_iu
=
self
.
ib
.
iu_store
[
self
.
sensor_iu
.
uid
]
with
self
.
assertRaises
(
ipaaca
.
IUCommittedError
):
received_iu
.
payload
[
'
data
'
]
=
'
updatedData
'
class
IpaacaRemoteWriteTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
...
...
@@ -153,13 +138,13 @@ class IpaacaRemoteWriteTestCase(unittest.TestCase):
def
tearDown
(
self
):
pass
def
testRemotePayloadChange
(
self
):
self
.
assert
In
(
self
.
i
u
.
uid
,
self
.
ib
.
iu_store
)
hc
.
assert
_that
(
self
.
i
b
.
iu_store
,
hc
.
has_key
(
self
.
iu
.
uid
)
)
received_iu
=
self
.
ib
.
iu_store
[
self
.
iu
.
uid
]
received_iu
.
payload
[
'
data
'
]
=
'
updatedData
'
time
.
sleep
(
0.1
)
self
.
assertEqual
(
self
.
iu
.
payload
[
'
data
'
],
'
updatedData
'
)
def
testRemotePayloadReplace
(
self
):
self
.
assert
In
(
self
.
i
u
.
uid
,
self
.
ib
.
iu_store
)
hc
.
assert
_that
(
self
.
i
b
.
iu_store
,
hc
.
has_key
(
self
.
iu
.
uid
)
)
received_iu
=
self
.
ib
.
iu_store
[
self
.
iu
.
uid
]
received_iu
.
payload
=
{
'
key1
'
:
'
value1
'
,
'
key2
'
:
'
value2
'
}
time
.
sleep
(
0.1
)
...
...
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