forked from robotframework/robotframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_using_libraries.py
More file actions
37 lines (26 loc) · 1.3 KB
/
test_using_libraries.py
File metadata and controls
37 lines (26 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import unittest
from robot.utils.asserts import assert_equal, assert_raises_with_msg
from robot.libraries.BuiltIn import BuiltIn, RobotNotRunningError
from robot.libraries.DateTime import Date
class TestBuiltInWhenRobotNotRunning(unittest.TestCase):
def test_using_namespace(self):
assert_raises_with_msg(RobotNotRunningError,
'Cannot access execution context',
BuiltIn().get_variables)
def test_using_namespace_backwards_compatibility(self):
assert_raises_with_msg(AttributeError,
'Cannot access execution context',
BuiltIn().get_variables)
def test_suite_doc_and_metadata(self):
assert_raises_with_msg(RobotNotRunningError,
'Cannot access execution context',
BuiltIn().set_suite_documentation, 'value')
assert_raises_with_msg(RobotNotRunningError,
'Cannot access execution context',
BuiltIn().set_suite_metadata, 'name', 'value')
class TestDateTime(unittest.TestCase):
def test_date_seconds(self):
secs = 1234567890
assert_equal(Date(secs).seconds, secs)
if __name__ == '__main__':
unittest.main()