コード例 #1
0
ファイル: test_helpers.py プロジェクト: bobsilverberg/fjord
 def test_fmts(self):
     eq_(convert_date_string(u'2013-04-03', in_fmt='%Y-%m-%d'), '2013-04-03')
     eq_(convert_date_string(u'2013-04-03T14:42:15', out_fmt='%Y'), '2013')
コード例 #2
0
ファイル: test_helpers.py プロジェクト: bobsilverberg/fjord
 def test_convert_date_string(self):
     eq_(convert_date_string('2013-04-03T14:42:15'), '2013-04-03')
     eq_(convert_date_string(u'2013-04-03T14:42:15'), '2013-04-03')
コード例 #3
0
ファイル: test_helpers.py プロジェクト: bobsilverberg/fjord
 def test_bad_input(self):
     self.assertRaises(TypeError, lambda: convert_date_string(None))
     self.assertRaises(ValueError, lambda: convert_date_string(''))
     self.assertRaises(
         ValueError,
         lambda: convert_date_string('2013-04-03', in_fmt='%H:%M:%S'))
コード例 #4
0
ファイル: test_helpers.py プロジェクト: bogomil/fjord
 def test_fmts(self):
     eq_(convert_date_string(u'2013-04-03', in_fmt='%Y-%m-%d'),
         '2013-04-03')
     eq_(convert_date_string(u'2013-04-03T14:42:15', out_fmt='%Y'), '2013')
コード例 #5
0
ファイル: test_helpers.py プロジェクト: bogomil/fjord
 def test_convert_date_string(self):
     eq_(convert_date_string('2013-04-03T14:42:15'), '2013-04-03')
     eq_(convert_date_string(u'2013-04-03T14:42:15'), '2013-04-03')
コード例 #6
0
ファイル: test_helpers.py プロジェクト: bogomil/fjord
 def test_bad_input(self):
     self.assertRaises(TypeError, lambda: convert_date_string(None))
     self.assertRaises(ValueError, lambda: convert_date_string(''))
     self.assertRaises(
         ValueError,
         lambda: convert_date_string('2013-04-03', in_fmt='%H:%M:%S'))