Back to index

python3.2  3.2.2
Classes | Functions
test.test_strftime Namespace Reference

Classes

class  StrftimeTest

Functions

def fixasctime
def escapestr
def test_main

Detailed Description

Unittest for time.strftime

Function Documentation

def test.test_strftime.escapestr (   text,
  ampm 
)
Escape text to deal with possible locale values that have regex
syntax while allowing regex syntax used for comparison.

Definition at line 19 of file test_strftime.py.

00019 
00020 def escapestr(text, ampm):
00021     """
00022     Escape text to deal with possible locale values that have regex
00023     syntax while allowing regex syntax used for comparison.
00024     """
00025     new_text = re.escape(text)
00026     new_text = new_text.replace(re.escape(ampm), ampm)
00027     new_text = new_text.replace('\%', '%')
00028     new_text = new_text.replace('\:', ':')
00029     new_text = new_text.replace('\?', '?')
00030     return new_text
00031 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 14 of file test_strftime.py.

00014 
00015 def fixasctime(s):
00016     if s[8] == ' ':
00017         s = s[:8] + '0' + s[9:]
00018     return s

Here is the caller graph for this function:

Definition at line 179 of file test_strftime.py.

00179 
00180 def test_main():
00181     support.run_unittest(StrftimeTest)