Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
AURA
engine
Commits
e64ebac2
Commit
e64ebac2
authored
3 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Initial EngineExecutor test case.
#72
parent
b988f0dc
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
tests/test.py
+37
-2
37 additions, 2 deletions
tests/test.py
with
37 additions
and
2 deletions
tests/test.py
+
37
−
2
View file @
e64ebac2
...
@@ -21,16 +21,21 @@
...
@@ -21,16 +21,21 @@
import
os
import
os
import
unittest
import
unittest
import
validators
import
validators
import
time
from
datetime
import
datetime
from
datetime
import
datetime
from
src.base.utils
import
SimpleUtil
as
SU
from
src.base.logger
import
AuraLogger
from
src.base.logger
import
AuraLogger
from
src.base.config
import
AuraConfig
from
src.base.config
import
AuraConfig
from
src.control
import
EngineExecutor
class
TestLogger
(
unittest
.
TestCase
):
class
TestLogger
(
unittest
.
TestCase
):
"""
Testing the Logger.
"""
aura_logger
=
None
aura_logger
=
None
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -42,7 +47,9 @@ class TestLogger(unittest.TestCase):
...
@@ -42,7 +47,9 @@ class TestLogger(unittest.TestCase):
class
TestConfig
(
unittest
.
TestCase
):
class
TestConfig
(
unittest
.
TestCase
):
"""
Testing the Configuration.
"""
config
=
None
config
=
None
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -79,5 +86,33 @@ class TestConfig(unittest.TestCase):
...
@@ -79,5 +86,33 @@ class TestConfig(unittest.TestCase):
class
TestEngineExecutor
(
unittest
.
TestCase
):
"""
Testing the EngineExecutor.
"""
def
setUp
(
self
):
None
def
test_single_executor
(
self
):
# Initialize stae and executor params
global_state
=
[
"
none
"
]
due_time
=
SU
.
timestamp
()
+
2
def
f
(
param
):
global_state
[
0
]
=
param
# Before the executor is done ther should be the initial value
e
=
EngineExecutor
(
"
RANDOM_NAMESPACE
"
,
None
,
due_time
,
f
,
"
hello world
"
)
self
.
assertEqual
(
"
none
"
,
global_state
[
0
])
self
.
assertNotEqual
(
"
hello world
"
,
global_state
[
0
])
# After 3 seconds there should be the updated value
time
.
sleep
(
5
)
self
.
assertEqual
(
"
hello world
"
,
global_state
[
0
])
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
unittest
.
main
()
unittest
.
main
()
\ No newline at end of file
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