Strptime

class badidatetime.tests.test_strptime.TestStrptime_DotDict(name)[source]

Bases: TestCase

_classSetupFailed = False
_class_cleanups = []
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_get()[source]

Test that the get method returns the correct object from the dictionary.

test_set()[source]

Test that the set method creates a new object in the dictionary.

class badidatetime.tests.test_strptime.TestStrptime_Functions(name)[source]

Bases: TestCase

_classSetupFailed = False
_class_cleanups = []
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test__calc_julian_from_U_or_W()[source]

Test that the _calc_julian_from_U_or_W function returns the day of the year. The week_of_year is from 0 to 50/51 The day_of_week is from 0 to 6. The 1st day is always week 0.

test__getlang()[source]

Test that the _getlang function returns the current language.

test__strptime_datetime()[source]

Test that the _strptime_datetime function returns an instance of the supplyed datetime class object.

test__strptime_time()[source]

Test that the _strptime_time function returns the correct time struct depending on the format data.

class badidatetime.tests.test_strptime.TestStrptime_LocaleTime(name)[source]

Bases: TestCase

This test is a bit different than most test. Since all the methods in the class are called in the constructor we need to test the results of each of the methods.

_classSetupFailed = False
_class_cleanups = []
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_LC_date()[source]

Test that the LC_date variable is set properly.

test_LC_date_time()[source]

Test that the LC_date_time variable is set properly.

test_LC_time()[source]

Test that the LC_time variable is set properly.

test_a_month()[source]

Test that the abbreviated months exist ard are in the correct order.

test_a_weekday()[source]

Test that the abbreviated weekdays exist ard are in the correct order.

test_am_pm()[source]

Test that the am_pm designators are properly set.

test_f_month()[source]

Test that the full months exist ard are in the correct order.

test_f_weekday()[source]

Test that the full weekdays exist ard are in the correct order.

test_timezone()[source]

Test that the timezone variable is set properly.

class badidatetime.tests.test_strptime.TestStrptime_StrpTime(name)[source]

Bases: TestCase

_classSetupFailed = False
_class_cleanups = []
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test__check_iso_week()[source]

Test that the _check_iso_week method raises the appropreate exceptions.

test__find_regex()[source]

Test that the _strptime function returns a complex tuple in the form of:

((year, month, day, None, None, hour, minute, second, weekday,
  julian, tz, tzname, gmroff),
 fraction, gmtoff_fraction)
test__miscellaneous()[source]

Test that the _miscellaneous method updates a few values.

Both weekday and week_of_year start their count with 0 not 1.

test__parse_found_dict()[source]

Test that the _parse_found_dict method correctly parses the arguments using the correct regex.

test_constructor_exception()[source]
test_multi_char_formats()[source]

Test that the _parse_found_dict method correctly parses multi character formats using the correct regex.

class badidatetime.tests.test_strptime.TestStrptime_TimeRE(name)[source]

Bases: TestCase

_classSetupFailed = False
_class_cleanups = []
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test___seqToRE()[source]

Test that the __seqToRE method returns an empty string when the to_convert argument has empty values.

test_pattern()[source]

Test that the pattern method returns a regex pattern.

test_regex_set_from_constructor()[source]

Test that the constructor set up 27 items in the custom dict.