aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'gsxws/core.py')
-rw-r--r--gsxws/core.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gsxws/core.py b/gsxws/core.py
index 55a086f..4fd4ee3 100644
--- a/gsxws/core.py
+++ b/gsxws/core.py
@@ -109,12 +109,16 @@ def validate(value, what=None):
>>> validate('XD368Z/A', 'partNumber')
True
+ >>> validate('XGWL2Z/A', 'partNumber')
+ True
>>> validate('ZM661-5883', 'partNumber')
True
>>> validate('661-01234', 'partNumber')
True
>>> validate('B661-6909', 'partNumber')
True
+ >>> validate('G143111400', 'dispatchId')
+ True
>>> validate('blaa', 'serialNumber')
False
>>> validate('MacBook Pro (Retina, Mid 2012)', 'productName')
@@ -126,12 +130,12 @@ def validate(value, what=None):
raise ValueError('%s is not valid input (%s != string)' % (value, type(value)))
rex = {
- 'partNumber': r'^([A-Z]{1,2})?\d{3}\-?(\d{4,5}|[A-Z]{1,2})(/[A-Z])?$',
+ 'partNumber': r'^([A-Z]{1,4})?\d{1,3}\-?(\d{1,5}|[A-Z]{1,2})(/[A-Z])?$',
'serialNumber': r'^[A-Z0-9]{11,12}$',
'eeeCode': r'^[A-Z0-9]{3,4}$',
'returnOrder': r'^7\d{9}$',
'repairNumber': r'^\d{12}$',
- 'dispatchId': r'^G\d{9}$',
+ 'dispatchId': r'^[A-Z]+\d{9,15}$',
'alternateDeviceId': r'^\d{15}$',
'diagnosticEventNumber': r'^\d{23}$',
'productName': r'^i?Mac',