Lines Matching defs:strftime
864 self.assertEqual(t.strftime("m:%m d:%d y:%y"), "m:03 d:02 y:05")
865 self.assertEqual(t.strftime(""), "") # SF bug #761337
866 self.assertEqual(t.strftime('x'*1000), 'x'*1000) # SF bug #1556784
868 self.assertRaises(TypeError, t.strftime) # needs an arg
869 self.assertRaises(TypeError, t.strftime, "one", "two") # too many args
870 self.assertRaises(TypeError, t.strftime, 42) # arg wrong type
873 self.assertEqual(t.strftime(u"%m"), "03")
876 self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
879 #self.assertRaises(ValueError, t.strftime, "%e")
880 #self.assertRaises(ValueError, t.strftime, "%")
881 #self.assertRaises(ValueError, t.strftime, "%#")
888 t.strftime(f)
893 t.strftime("%f")
907 # check that a derived class's strftime gets called
909 def strftime(self, format_spec):
918 self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
919 self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
1061 self.assertEqual(cls(1900, 1, 1).strftime("%Y"), "1900")
1063 self.assertRaises(ValueError, cls(y, 1, 1).strftime, "%Y")
1217 # check that a derived class's strftime gets called
1219 def strftime(self, format_spec):
1228 self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
1229 self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
1275 self.assertRaises(TypeError, t.strftime, '%Z')
1581 self.assertEqual(t.strftime("%m %d %y %f %S %M %H %j"),
1855 self.assertEqual(t.strftime('%H %M %S %f'), "01 02 03 000004")
1857 self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
1870 # check that a derived class's strftime gets called
1872 def strftime(self, format_spec):
1879 self.assertEqual(t.__format__(fmt), t.strftime(fmt))
1880 self.assertEqual(a.__format__(fmt), t.strftime(fmt))
2230 self.assertEqual(t1.strftime("%H:%M:%S %%Z=%Z %%z=%z"),
2232 self.assertEqual(t2.strftime("%H:%M:%S %Z %z"), "12:47:00 UTC +0000")
2233 self.assertEqual(t3.strftime("%H:%M:%S %Z %z"), "13:47:00 MET +0100")
2237 self.assertEqual(t1.strftime("%H:%M %%Z='%Z' %%z='%z'"),
2244 self.assertEqual(t.strftime("%H:%M:%S"), "02:03:04")
2245 self.assertRaises(TypeError, t.strftime, "%Z")