コード例 #1
0
ファイル: test_photo.py プロジェクト: chrisrossi/edwin
    def test_metadata(self):
        from edwin.models.photo import Photo
        p = Photo(self.fname)
        p.photographer = 'Santa Clause'
        p.location = 'North Pole'
        p.title = 'Mrs. Clause and the elves'
        p.desc = 'Mrs. Clause and the elves blow off some steam.'
        self.assertEqual(p.version, 1)
        self.assertEqual(p.size, (3072, 2304))

        del p
        p = Photo(self.fname)
        self.assertEqual(p.photographer, 'Santa Clause')
        self.assertEqual(p.location, 'North Pole')
        self.assertEqual(p.title, 'Mrs. Clause and the elves')
        self.assertEqual(
            p.desc, 'Mrs. Clause and the elves blow off some steam.'
        )
        self.assertEqual(p.version, 1)