示例#1
0
文件: tests.py 项目: jchmura/PiE
 def test_convert_price(self):
     attributes = {
         'description': '',
         'price': '6.28',
         'publish_date': datetime.now().strftime(parser.DATE_FORMAT)
     }
     parser.convert_attributes(attributes)
     self.assertEqual(6.28, attributes['price'])
示例#2
0
文件: tests.py 项目: jchmura/PiE
 def test_convert_price(self):
     attributes = {
         'description': '',
         'price': '6.28',
         'publish_date': datetime.now().strftime(parser.DATE_FORMAT)
     }
     parser.convert_attributes(attributes)
     self.assertEqual(6.28, attributes['price'])
示例#3
0
文件: tests.py 项目: jchmura/PiE
 def test_convert_date(self):
     attributes = {
         'description': '',
         'price': '0',
         'publish_date': '2015-04-03'
     }
     parser.convert_attributes(attributes)
     date = datetime(2015, 4, 3)
     self.assertEqual(date, attributes['publish_date'])
示例#4
0
文件: tests.py 项目: jchmura/PiE
 def test_convert_date(self):
     attributes = {
         'description': '',
         'price': '0',
         'publish_date': '2015-04-03'
     }
     parser.convert_attributes(attributes)
     date = datetime(2015, 4, 3)
     self.assertEqual(date, attributes['publish_date'])
示例#5
0
文件: tests.py 项目: jchmura/PiE
 def test_convert_description(self):
     before = 'Lorem ipsum dolor sit amet, \n     consectetur adipiscing elit,\n     sed do eiusmod tempor\n   incididunt ut labore et dolore magna aliqua.'
     attributes = {
         'description': before,
         'price': '0',
         'publish_date': datetime.now().strftime(parser.DATE_FORMAT)
     }
     parser.convert_attributes(attributes)
     self.assertEqual(
         'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
         attributes['description'])
示例#6
0
文件: tests.py 项目: jchmura/PiE
 def test_convert_description(self):
     before = 'Lorem ipsum dolor sit amet, \n     consectetur adipiscing elit,\n     sed do eiusmod tempor\n   incididunt ut labore et dolore magna aliqua.'
     attributes = {
         'description': before,
         'price': '0',
         'publish_date': datetime.now().strftime(parser.DATE_FORMAT)
     }
     parser.convert_attributes(attributes)
     self.assertEqual(
         'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
         attributes['description'])