File: scripts.txt

package info (click to toggle)
zope-cmfplone 2.5.1-4etch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 7,752 kB
  • ctags: 5,237
  • sloc: python: 28,264; xml: 3,723; php: 129; makefile: 99; sh: 2
file content (58 lines) | stat: -rw-r--r-- 1,299 bytes parent folder | download | duplicates (2)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Test for scripts
================

This test suite tests various python scripts. Ultimately these tests should be
doctests provided directly in the implementation (as utilities for example).

Tests for returnNone.py
-----------------------

This should be self-explanatory:

  >>> self.portal.returnNone() is None
  True

Tests for reverseList.py
------------------------

Test with a list:

  >>> self.portal.reverseList([1, 2, 3])
  [3, 2, 1]

Test with a dict:

  >>> self.portal.reverseList((1, 2, 3))
  [3, 2, 1]

Tests for spamProtect.py
------------------------

Test with only one argument:

  >>> self.portal.spamProtect('mailto:spam@plone.org')
  '<a href="&#0109;ailto&#0058;mailto&#0058;spam&#0064;plone.org">mailto&#0058;spam&#0064;plone.org</a>'

Also provide a second name argument:
    
  >>> self.portal.spamProtect('mailto:spam@plone.org', 'send your spam here')
  '<a href="&#0109;ailto&#0058;mailto&#0058;spam&#0064;plone.org">send your spam here</a>'

Tests for unique.py
-------------------

Test a list of numbers which contains duplicates:

  >>> self.portal.unique([1,2,3,1,2,3])
  [1, 2, 3]

Test a string sequence:

  >>> self.portal.unique('abcabc')
  ['a', 'c', 'b']

And finally a tuple of lists:

  >>> self.portal.unique(([1, 2], [2, 3], [1, 2]))
  [[1, 2], [2, 3]]