Skip to content

Commit 31a226e

Browse files
committed
cleaned up tests and removed some duplicate tests
1 parent 64c8244 commit 31a226e

2 files changed

Lines changed: 18 additions & 47 deletions

File tree

‎test/atest/failures.txt‎

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,30 @@ Resource resource.txt
33

44
*** Test Cases ***
55
Base Exception
6-
[Documentation] FAIL My message
6+
[Documentation] FAIL My message
77
Base Exception
88

99
Exception Without Message
10-
[Documentation] FAIL Exception
10+
[Documentation] FAIL Exception
1111
Exception Without Message
1212

13-
Assertion Error
14-
[Documentation] FAIL Failure message
13+
AssertionError
14+
[Documentation] FAIL Failure message
1515
Assertion Error
1616

17-
Runtime Error
18-
[Documentation] FAIL Error message
17+
RuntimeError
18+
[Documentation] FAIL Error message
1919
Runtime Error
2020

21-
Name Error
22-
[Documentation] FAIL REGEXP: (NameError: |undefined local variable ).*
23-
Name Error
24-
25-
Attribute Error
26-
[Documentation] FAIL REGEXP: (AttributeError: |undefined method).*
27-
Attribute Error
28-
29-
Index Error
30-
[Documentation] FAIL REGEXP: (IndexError: ).*
31-
Index Error
32-
3321
Zero Division
34-
[Documentation] FAIL REGEXP: (ZeroDivisionError: ).*|divided by 0
22+
[Documentation] FAIL STARTS: ZeroDivisionError:
3523
Zero Division
3624

3725
Custom Exception
38-
[Documentation] FAIL REGEXP: (MyException: |)My message
26+
[Documentation] FAIL MyException: My message
3927
Custom Exception
4028

4129
Failure Deeper
42-
[Documentation] FAIL Finally failing
30+
[Documentation] FAIL Finally failing
4331
Failure Deeper
4432

‎test/libs/examplelib.py‎

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
import sys
2-
3-
4-
class RemoteTestLibrary:
5-
1+
class AcceptanceTestLibrary:
62
_unicode = (u'Hyv\u00E4\u00E4 y\u00F6t\u00E4. '
73
u'\u0421\u043F\u0430\u0441\u0438\u0431\u043E!')
84

9-
def get_server_language(self):
10-
lang = sys.platform.startswith('java') and 'jython' or 'python'
11-
return '%s%d%d' % (lang, sys.version_info[0], sys.version_info[1])
12-
135
# Basic communication (and documenting keywords)
146

157
def passing(self):
@@ -79,15 +71,6 @@ def assertion_error(self):
7971
def runtime_error(self):
8072
raise RuntimeError('Error message')
8173

82-
def name_error(self):
83-
non_existing
84-
85-
def attribute_error(self):
86-
self.non_existing
87-
88-
def index_error(self):
89-
[][0]
90-
9174
def zero_division(self):
9275
1/0
9376

@@ -176,7 +159,7 @@ def list_containing_objects_as_argument(self, arg):
176159
self._should_be_equal(arg, ['<MyObject1>', '<MyObject2>'])
177160

178161
def nested_list_as_argument(self, arg):
179-
exp = [ [True, False], [[1, '', '<MyObject>', {}]] ]
162+
exp = [[True, False], [[1, '', '<MyObject>', {}]]]
180163
self._should_be_equal(arg, exp)
181164

182165
def dictionary_as_argument(self, arg):
@@ -195,8 +178,8 @@ def dictionary_containing_objects_as_argument(self, arg):
195178
self._should_be_equal(arg, {'As value': '<MyObject1>', '<MyObject2>': 'As key'})
196179

197180
def nested_dictionary_as_argument(self, arg):
198-
exp = { '1': {'': False},
199-
'2': {'A': {'n': ''}, 'B': {'o': '<MyObject>', 'e': {}}} }
181+
exp = {'1': {'': False},
182+
'2': {'A': {'n': ''}, 'B': {'o': '<MyObject>', 'e': {}}}}
200183
self._should_be_equal(arg, exp)
201184

202185
def _should_be_equal(self, arg, exp):
@@ -257,7 +240,7 @@ def return_list_containing_objects(self):
257240
return [MyObject(1), MyObject(2)]
258241

259242
def return_nested_list(self):
260-
return [ [True, False], [[1, None, MyObject(), {}]] ]
243+
return [[True, False], [[1, None, MyObject(), {}]]]
261244

262245
def return_tuple(self):
263246
return (1, 'two', True)
@@ -266,7 +249,7 @@ def return_empty_tuple(self):
266249
return ()
267250

268251
def return_nested_tuple(self):
269-
return ( (True, False), [(1, None, MyObject(), {})] )
252+
return ((True, False), [(1, None, MyObject(), {})])
270253

271254
def return_dictionary(self):
272255
return {'one': 1, 'spam': 'eggs'}
@@ -284,8 +267,8 @@ def return_dictionary_containing_objects(self):
284267
return {'As value': MyObject(1), MyObject(2): 'As key'}
285268

286269
def return_nested_dictionary(self):
287-
return { 1: {None: False},
288-
2: {'A': {'n': None}, 'B': {'o': MyObject(), 'e': {}}} }
270+
return {1: {None: False},
271+
2: {'A': {'n': None}, 'B': {'o': MyObject(), 'e': {}}}}
289272

290273
# Not keywords
291274

@@ -312,4 +295,4 @@ class MyException(Exception):
312295
import sys
313296
from robotremoteserver import RobotRemoteServer
314297

315-
RobotRemoteServer(RemoteTestLibrary(), *sys.argv[1:])
298+
RobotRemoteServer(AcceptanceTestLibrary(), *sys.argv[1:])

0 commit comments

Comments
 (0)