Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update README.md

  • Loading branch information...
commit 8af87dd437ac887754f0c00c931fdefb76dab4bf 1 parent ba84321
mkasfeldt authored

Showing 1 changed file with 1 addition and 51 deletions. Show diff stats Hide diff stats

  1. +1 51 README.md
52 README.md
Source Rendered
... ... @@ -1,57 +1,7 @@
1 1 Alphanumeric-Incementor
2 2 =======================
3   -Test
4 3
5 4 simple function to increment a alpha-numeric key to the next value
6   -note value follows: 0 < A < a therefor 9 is less than P and Z is less than b
7   -:param value: The value passed to the function
8   -:type value: String
9   -:param onlycaps: Use only capital letters, defaults to True
10   -:type onlycaps: Boolean
11   -:param increment: Number of increments to add, defaults to 1
12   -:type increment: Integer
13   -:param strlen: length of the value
14   -:type maxlen: Integer
15   -:return: the incremented value
16   -:rtype: String
17   -values that should pass
18 5
19   ->>> anIncrement('0000000000')
20   -'0000000001'
21   ->>> anIncrement('0000000009')
22   -'000000000A'
23   ->>> anIncrement('000000000Z')
24   -'0000000010'
25   ->>> anIncrement('000000000Z',onlycaps=False)
26   -'000000000a'
27   ->>> anIncrement('000000000z',onlycaps=False)
28   -'0000000010'
29   ->>> anIncrement('00000000z',strlen=9,onlycaps=False)
30   -'000000010'
  6 +note value follows: 0 < A < a therefore 9 is less than P and Z is less than b
31 7
32   -values that should raise exceptions
33   -
34   ->>> anIncrement('zzzzzzzzzz',onlycaps=False)
35   -Traceback (most recent call last):
36   - ...
37   -RuntimeError: incremented value greater than the maximum permitted value
38   ->>> anIncrement('ZZZZZZZZZZ')
39   -Traceback (most recent call last):
40   - ...
41   -RuntimeError: incremented value greater than the maximum permitted value
42   ->>> anIncrement('000000000')
43   -Traceback (most recent call last):
44   - ...
45   -ValueError: input value not equal to required string length:10
46   ->>> anIncrement('000000000a')
47   -Traceback (most recent call last):
48   - ...
49   -ValueError: input value has non-numeric or non-capitalized-letter characters
50   ->>> anIncrement('000000000!',onlycaps=False)
51   -Traceback (most recent call last):
52   - ...
53   -ValueError: input value has non-numeric or non-letter characters
54   ->>> anIncrement('00000000a!',onlycaps=False)
55   -Traceback (most recent call last):
56   - ...
57   -ValueError: input value has non-numeric or non-letter characters

0 comments on commit 8af87dd

Please sign in to comment.
Something went wrong with that request. Please try again.